Video examples
iOS Voiceover
Android Talkback
Windows Jaws Chrome
Windows NVDA Chrome
MacOS Voiceover Safari
Headings are not focusable with the tab key
- When people use a screen reader, the arrow keys are used to browse non-focusable content
- The tab key only focuses interactive elements (ex: buttons, links or inputs)
Bad example
- Divorce styles and token names from markup completely
- Directly styling headings forces heading order to lose meaning
- While this seems better, it really isn’t.
- Even though
class="h1"
could be applied to any element, developers WILL interpret this as<h1 class="h1">
Good example
- Set all headings to a small default to force devs to seek correct styles
- Choose naming conventions without implied semantics
- Styles are now separated from markup
- This allows the preservation of good heading structure and flexibility in design
When you can’t use semantic HTML
This custom header requires extra attributes.