Skip to main content
Raasta
MinorBest practiceempty-heading

Heading is empty

A heading with no text is still announced as a heading, so people jumping between headings land on silence. Put text in it, or remove the heading tag if it was only there for spacing or an icon.

Who it hurts

Screen reader users, who navigate by headings to skim a page.

Often left behind when a theme setting is blank, or when a heading holds only an icon or an image with no alt text.

How to fix it

Pick your stack. Review every change before you ship it.

Before

<h2 class="spacer"></h2>

After

<div class="spacer" aria-hidden="true"></div>

Check it by hand too

List the headings with a browser extension or your screen reader. Every heading should have words, and they should read like a table of contents.

Automated checks find a large share of accessibility problems, but not all of them. Passing this check does not on its own make a page compliant.