Skip to main content

Structure for HTMLs

HTML structure is the skeleton every page shares: the doctype, the html element with a lang attribute, a head for metadata and a body for visible content. Within the body, headings from h1 to h6, paragraphs, lists and links organise text. Correct nesting and a logical heading order make a page readable by people and machines.

Stage: Document Basics · Part of the HTML roadmap · Last reviewed 19 November 2026

What to learn in Structure

Structure interview questions

Why is the doctype declaration needed in an HTML page?

The doctype, written as <!DOCTYPE html>, tells the browser to render in standards mode. Without it browsers fall back to quirks mode, which imitates old behaviour and can make layout and box sizing differ from what you expect.

How many h1 elements should a page have?

Usually one, describing the main topic of the page, followed by h2 to h6 in a nested order without skipping levels. HTML does not forbid several, but a single clear h1 helps screen reader users and search engines understand the page.

Where Structure fits in the HTML roadmap

Structure belongs to the Document Basics stage (beginner level), which takes about 8 hours. The skeleton of a page.

Back to the full HTML roadmap