Top Five Accessibility Issues: 2. Empty Heading
Empty heading
What It Means
A heading that contains no content. How do these empty headings occur? It is the easiest thing to accidentally create one: you insert a heading in one of your pages. However, then you decide to delete it, but you do so by only deleting the text. The HTML tag which creates a heading remains, hidden in the code. Sneaky!
Why It Matters
Some users, especially keyboard and screen reader users, often navigate by heading elements. An empty heading will present no information and may introduce confusion.
What To Do
Ensure that all headings contain informative content.
Fixing this issue is pretty straightforward compared to some other accessibility problems on a website. The main complexity with empty headers is finding them in the first place. Why? Because they’re empty! Yep, empty as my vacation plans during COVID-19. So how do you spot them?
If we have run an accessibility report for your site, we can provide the addresses of pages where the empty heading tags are. Then you can:
- Log into your site, edit the page where we reported the error and
- Click on the Text tab to view the HTML that creates your page.
- Search your page (using CTRL+F (Windows) or CMD+F (Mac)) for empty heading tags. These are most likely to be <h2></h2> or <h3></h3> or <h4></h4>
- When you find them, delete them! You might need to remove a blank line if the empty header was sitting between two paragraphs.
Alternatively, you can scan your pages and try and find them by eye. It can be difficult to spot them; however, a suspiciously large gap between two paragraphs is a clue. Here is an example of a heading that’s emptier than a politician’s promise [located between the first and second paragraphs below]:
Introduction
Cats in ancient Egypt were represented in social and religious practices of ancient Egypt for more than 3,000 years. Several ancient Egyptian deities were depicted and sculptured with cat-like heads such as Mafdet, Bastet and Sekhmet, representing justice, fertility and power. The deity Mut was also depicted as a cat and in the company of a cat.
Cats were praised for killing venomous snakes and protecting the Pharaoh since at least the First Dynasty of Egypt. Skeletal remains of cats were found among funerary goods dating to the 12th Dynasty. The protective function of cats is indicated in the Book of the Dead, where a cat represents Ra and the benefits of the sun for life on Earth.
In this situation, you could just edit the page and delete two of the three empty lines between the two paragraphs – this will remove the empty <h3></h3> tag which is hiding there. It is definitely harder to find them this way.
Look out for the next post about the third most frequent accessibility issue: Empty Links!
For more information about empty headings, visit module 2 of our accessibility training: