HTML / LESSON 01

Your first HTML page

Start with a document, not a blank screen.

Beginner7 min read · estimateUpdated Nov 1, 2026
In this lessonThe structure of a pageWhat belongs whereSave it and open itTry it yourselfFurther reading

01The structure of a page

HTML describes the meaning and structure of content. CSS controls its presentation, and JavaScript adds behavior. A browser can open an HTML file directly.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My first page</title>
</head>
<body>
  <h1>Hello, web.</h1>
  <p>This is my first page.</p>
</body>
</html>

02What belongs where

The head holds document information: title, character encoding and linked styles. The body holds visible content. The lang attribute tells assistive technology the page language.

<head>
  <title>A useful browser-tab title</title>
</head>
<body>
  <p>Something worth reading.</p>
</body>

03Save it and open it

Create a file called index.html in your editor, paste the complete document, save it and open it in a browser. Save your edits and refresh to see changes. Check that the file is not accidentally named index.html.txt.

04Try it yourself

Change the heading and add a second paragraph.

EDITABLE EXAMPLE

HTML & CSS only. Scripts and form submissions are disabled.

Further reading

Use the MDN learning guides and HTML Living Standard for deeper explanations and current browser guidance.

ONE STEP FURTHER

Small steps. Real understanding.

Try the example in your own project before moving on.

Progress is saved only in this browser.