$html-docs
InstallDevelopersPricingSign inOpen drive
All HTML guides
Accessibility6 min read·July 29, 2026

How to Create a Clear HTML Heading Structure

Turn a visual page into a dependable outline that helps readers scan, navigate, and understand the content.

The short version

Headings are the table of contents embedded in the page.

01

Write the outline before styling it

Most pages should have one clear h1 that names the page. Major ideas beneath it use h2, and details inside those sections use h3. The number describes hierarchy, not font size.

A reader should be able to skim only the headings and still understand the argument. If the outline feels vague or repetitive, the body will usually feel that way too.

02

Avoid skipped levels and decorative headings

Jumping from h2 to h4 suggests a missing level. Using a heading because it happens to be bold creates a false section in the document outline. Use CSS classes for appearance and reserve heading elements for sections.

html
<main>
  <h1>Migration plan</h1>
  <section>
    <h2>Current system</h2>
    <h3>Known constraints</h3>
  </section>
  <section>
    <h2>Proposed rollout</h2>
    <h3>Phase one</h3>
  </section>
</main>
03

Make headings do real navigation work

Add stable ids when headings need direct links. Keep the visible wording concise and specific. In long documents, a generated table of contents can link to those ids without creating a second navigation model.

When an AI agent drafts the page, ask it to return the heading outline separately. Reviewing that outline first is a fast way to catch duplicated sections and missing transitions.

Official references

  • W3C WAI: Headings
  • WHATWG: Headings and sections

In this guide

  1. 01Write the outline before styling it
  2. 02Avoid skipped levels and decorative headings
  3. 03Make headings do real navigation work
Publish a page

Keep going

Related HTML guides

Browse all 24 guides
Accessibility8 min read

How to Build Accessible HTML Forms

Connect every field to a label, group related controls, explain errors clearly, and make the full flow work from a keyboard.

Read guide
Accessibility7 min read

How to Make HTML Tables Easy to Read

Use captions, headers, scope, and responsive wrappers so dense data keeps its meaning on every screen.

Read guide
Accessibility5 min read

Links or Buttons? How to Choose the Right HTML Control

Use links for navigation and buttons for actions, then write labels that make the result clear before someone clicks.

Read guide
© 2026 HTML DocsInstallSupportPrivacyTermsAPI