Back to HTML

HTML Headings and the Document Outline

Coding Tutorials Team 22 July 2026

There are six heading levels, and almost everyone learns them as a set of decreasing font sizes. That is the wrong model. Headings define the structure of your document, and the sizes are only default styles that any stylesheet can overturn. Understanding what they are actually for changes how you use them.

Headings create a hierarchy, not a size scale

A level one heading is the title of the whole page. Level two headings are its major sections. Level three headings are subsections of those, and so on down. The relationship is one of containment, exactly like a book with chapters and subsections.

<h1>Learning CSS</h1> <h2>Selectors</h2> <h3>Class selectors</h3> <h3>Pseudo-classes</h3> <h2>The box model</h2>

Read the headings alone and you should get a coherent summary of the page. If that outline reads as nonsense, the structure is wrong even if the page looks correct.

Why this matters more than it appears to

Screen reader users very commonly navigate by pulling up a list of headings and jumping to the section they want, rather than reading a page top to bottom. Surveys of screen reader users have consistently found this to be one of the most used navigation methods available. A page with no headings, or with headings applied for visual size, removes that entirely and leaves someone scrolling through everything.

Search engines also use headings to understand what a page covers and which parts of it answer which question. That influence is modest compared to the content itself, but it is real, and it costs nothing to get right.

Do not skip levels

Going from a level two heading straight to a level four implies a missing section, which is confusing when the outline is read as a list. The rule is simple: you may go down only one level at a time, but you may jump back up as many levels as you need when a section ends.

The usual reason people skip is that the next level down looks too large or too small. That is a styling problem with a styling solution. Choose the level that reflects the structure, then set whatever font size you want in CSS.

How many level one headings

The traditional advice is exactly one per page, matching the single main subject. The specification technically permits more, and the outline algorithm that was supposed to make multiple ones work correctly was never implemented by any browser and has since been removed from the standard.

Because that algorithm does not exist in practice, one level one heading per page remains the sound advice. It should describe what the page is about and will usually resemble your title tag without being identical, since the title also has to work out of context in a results list.

Headings are not for emphasis

Using a heading to make a line of text large and bold is the most common misuse. It inserts a phantom section into your outline, and someone navigating by headings lands on something that turns out not to be a section at all.

The reverse mistake is equally common: styling a paragraph to look like a heading using CSS alone. It looks right and is structurally invisible, so nobody navigating by structure will ever find it. If it introduces a section, it is a heading. If it does not, it is not.

Headings inside sections

Sectioning elements such as article, section and aside each expect a heading. A section without one is a warning in the validator for good reason, because a region with no label is difficult to describe to anyone who cannot see the visual grouping.

<article> <h2>Understanding specificity</h2> <p>...</p> </article>

Note that the level is decided by the position of the section in the overall page, not by the fact that it is inside an article. Nesting does not automatically demote a heading.

Writing the text itself

A heading should be meaningful when read in isolation, because that is exactly how it will be read by anyone using a heading list. Something vague tells them nothing about what is underneath it, whereas a specific phrase lets them decide whether to stop there.

Keep them reasonably short, front load the distinctive words, and avoid repeating the same phrasing across several sections. Where a section answers a question people actually ask, phrasing the heading as that question is both natural to read and a good match for how people search.

Checking your outline

Browser extensions exist that display the heading structure of a page as an indented list, and running one over a page you have built is a fast sanity check. Anything that looks odd in that list, whether a skipped level, a missing section title or a heading that turns out to be decoration, is worth correcting before publication.