31 lines
1.6 KiB
Plaintext
31 lines
1.6 KiB
Plaintext
:doctype: book
|
|
|
|
# tag::header[]
|
|
== Why is this an issue?
|
|
|
|
Heading elements are represented by the tags ``++<h1>++`` through ``++<h6>++``, with ``++<h1>++`` being the highest level and ``++<h6>++`` being the lowest. These elements are used to structure the content of the page and create a hierarchical outline that can be followed by users and search engines alike.
|
|
|
|
In the context of accessibility, heading elements play a crucial role. They provide a way for users, especially those using assistive technologies like screen readers, to navigate through the content of a webpage. By reading out the headings, screen readers can give users an overview of the content and allow them to jump to the section they're interested in.
|
|
|
|
If a heading element is empty, it can lead to confusion as it doesn't provide any information about the content that follows. This can make navigation difficult for users relying on screen readers, resulting in a poor user experience and making the website less accessible for people with visual impairments.
|
|
|
|
Therefore, to ensure your website is accessible to all users, it's important to always include meaningful content in your heading elements.
|
|
|
|
== How to fix it
|
|
|
|
Do not leave empty your heading elements.
|
|
|
|
# end::header[]
|
|
|
|
=== Code examples
|
|
|
|
# tag::footer[]
|
|
== Resources
|
|
=== Documentation
|
|
|
|
* MDN web docs - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements[Heading elements]
|
|
* MDN web docs - https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden[aria-hidden]
|
|
* WCAG - https://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-descriptive.html[Headings and Labels]
|
|
|
|
# end::footer[]
|