In many designs, a number of headings may appear in the header, footer, or other global elements of a website. One example would be denoting "Contact Us," "Our Address," and similar sections in the page footer, or a tagline in the page header.
In these cases, I've historically tended to use <h6>
elements, as they're the lowest priority heading, and therefore I assumed that the would be best suited to this use case.
However, I recently started trying to improve accessibility on my projects, and I've found that essentially every automated a11y testing tool says that this isn't the correct way to do this. I constantly get errors stating "the heading structure is not logically nested" because <h6>
either appears before any other heading (in the case of a tagline in the page header), or jumps from an earlier heading to <h6>
(in the case of footer titles, when the rest of the content stops after anything less than <h5>
).
I would just change the <h6>
in the header and footer to <p>
styled to match their original designs, but that seems incorrect to me – shouldn't each section with a heading in the footer be denoted with an actual heading?
What is the appropriate way to denote headings in global elements of a page to ensure accessibility?