What is HTML? Your first page

What a program and a document are, and your first working page.

1. What is this?

A program is a set of instructions a computer follows. HTML (HyperText Markup Language) is not logic — it is a way to describe the structure of a document using tags. A tag is a label in angle brackets, like <p>, that marks where a paragraph starts and ends. The browser reads these labels and draws the page.

2. Why do we use it?

Every website — blogs, shops, dashboards — is an HTML document underneath. Search engines, screen readers, and browsers all start from your HTML. If the structure is wrong, nothing else works well.

3. Syntax breakdown

  • <!doctype html>

    Tells the browser: this is a modern HTML document. Always first.

  • <h1>Hello</h1>

    h1 is a top-level heading. The opening <h1> starts it, </h1> (with slash) ends it.

  • <p>Text here</p>

    p marks a paragraph. Browsers add spacing around it automatically.

5. Common mistakes

  • Forgetting the closing tag: <p>text with no </p> makes the browser guess where it ends.
  • Typing <h1> but closing with </h2> — opening and closing names must match.
  • Putting visible text outside <body> — browsers may still show it, but it is invalid.

Practice task

Change the heading to your name and add a second paragraph saying what you want to build.

Hint

Copy the <p>...</p> line and paste it below, then change the words inside.

Try it below — tests run automatically when you press Run.

html

Live preview (sandboxed)

Output

Press Run to see output.

Mini quiz

3 questions. Answer, then check.

  1. 1. What does HTML describe?

  2. 2. Which closes a paragraph correctly?

  3. 3. Where does visible content go?

4. Example — edit and run

html

Live preview (sandboxed)

Output

Press Run to see output.

Expected output: Renders a heading and a paragraph in the preview.