Skip to content
Codewilds

Lesson 1 of 29 · HTML Basics

HTML Hello World: Your First Web Page

easy10 XP1 min readFree lesson

Every website you have ever visited is built with HTML — HyperText Markup Language. HTML describes what is on a page: this is a heading, this is a paragraph, this is a link. In this first lesson you'll write a tiny page and watch the browser draw it.

Tags and elements

HTML is made of tags in angle brackets. Most tags come in pairs: an opening tag like <p> and a closing tag like </p> with a slash. Together with the content between them they form an element:

<p>This is a paragraph.</p>

The browser reads the tags and decides how to show the content. An <h1> element is the page's main heading — big and bold. A <p> element is a paragraph of normal text:

<h1>My first page</h1>
<p>I'm learning HTML.</p>

The page skeleton

A complete HTML document has a small skeleton around the content:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>My first page</title>
  </head>
  <body>
    <h1>My first page</h1>
  </body>
</html>
  • <!doctype html> tells the browser this is a modern HTML page.
  • <head> holds information about the page, like the <title> shown in the browser tab.
  • <body> holds everything you see on the page.

Indentation doesn't change how the page looks — it just keeps your code readable, so the editor keeps it for you.

Common mistakes

  • Forgetting the closing tag. <h1>Hello without </h1> turns everything after it into part of the heading.
  • Typos in tag names. <pp> is not an HTML element, so the browser shows the text without any meaning.

Assignment

Inside <body>, add:

  1. A main heading (<h1>) with the text Hello, World!
  2. A paragraph (<p>) below it with the text I'm learning HTML.

Watch the Preview tab while you type, then press Submit.

Keep learning

Need a quick reminder? The HTML & CSS cheat sheet has every topic of Learn HTML & CSS on one page.

Lesson last updated on .

Write code ↓
HTML & CSS+10 XP