Lesson · Beginner

Your first HTML page

Create a complete HTML document, open it in a browser, and understand what each required part contributes.

Editorial preview — publication review is still required.

Author
Editorial team
Reviewer
Publication review pending
Review tier
annual

The direct answer

An HTML page is a text file whose markup gives content meaning and structure. The browser parses that markup into a document it can display and expose to assistive technology.

Start with a complete document

<!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>I made a complete HTML document.</p>
  </body>
</html>

Save this as index.html, then open it in a browser. The filename is ordinary; the document structure is what makes it HTML.

Why this works

The doctype selects modern HTML parsing. The lang value describes the document language. Metadata belongs in head; visible content belongs in body. The title names the browser tab and often supplies the default search result title.

Common mistakes

  • Putting visible headings inside head.
  • Omitting the language when the page language is known.
  • Using line breaks or bold text instead of meaningful headings and paragraphs.

Exercise

Change the title, heading, and paragraph. Reload the page and identify where each change appears.

Solution check

The title should change the tab label. The heading and paragraph should change inside the page. If they do not, confirm that you saved and reopened the same file.