Rule

Empty headings

Headings must contain text.

Rule
empty-heading
Type
Best practice, not a WCAG requirement. It runs when Best practices is switched on.
Severity
Minor

What it checks

Every <h1> to <h6>, and every element with role="heading", needs an accessible name. A heading with no text, and nothing else that gives it a name, fails. An element whose explicit role makes it something other than a heading is not judged as one.

Screen reader users often move through a page by its headings. An empty one is a stop that says nothing, or a level announced with no words after it.

Example

Fails

<h2><span class="icon-star"></span></h2>
<p>Rated five stars by readers.</p>

Passes

<h2>Reader reviews</h2>
<p>Rated five stars by readers.</p>

The engine is tested against both examples.

How to fix it

Put text in the heading, or remove the element if it only adds space or holds an icon.

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.