Rule
Heading order
Headings should step down one level at a time.
- Rule
heading-order- Type
- Best practice, not a WCAG requirement. It runs when Best practices is switched on.
- Severity
- Moderate
What it checks
The rule reads the page's headings in order and fails any heading that is more than one level deeper than the one before it, such as an <h3> straight after an <h1>. Going back up any number of levels is fine. A heading's level is its aria-level when set, otherwise the digit in its tag; role="heading" with no level counts as level 2. A heading whose role is overridden, for example with role="none", is left out of the outline.
Screen readers list headings by level so people can grasp a page's structure and jump within it. A skipped level suggests a missing section, and makes it harder to tell which part belongs to which.
Example
Fails
<main>
<h1>Annual report</h1>
<h3>Income</h3>
<p>Income rose this year.</p>
</main>
Passes
<main>
<h1>Annual report</h1>
<h2>Income</h2>
<h3>Donations</h3>
<h2>Spending</h2>
</main>
The engine is tested against both examples.
How to fix it
Use the next level down for each subsection. If a heading looks too large, change its style rather than its level.
Check your own pages
This rule runs in every pour audit: the browser extension, the bookmarklet, the command line and the editor. Get pour, free.