Unique Landmarks Accessibility Guide
Rule ID: landmark-unique
Ruleset: axe-core 4.10
User Impact: Moderate
Guidelines: Deque Best Practice
How to Fix the Problem
To resolve the “landmark-unique” issue, ensure that every landmark (like <main>
, <header>
, <footer>
, <nav>
, or elements with landmark roles such as role="banner"
, role="form"
, etc.) has a unique combination of role and accessible name.
Here’s how you can do this:
✅ Correct Usage Examples
-
Unique landmark elements:
-
Forms with unique aria-labels:
-
Forms with unique aria-labelledby references:
-
Asides with unique labeling:
❌ Incorrect Usage Examples (What to Avoid)
-
Duplicate landmark roles:
-
Same
aria-label
used more than once: -
Duplicate
aria-labelledby
values pointing to same element: -
Same role without additional label:
Best Practices
-
Always label landmarks uniquely using
aria-label
,aria-labelledby
, or by ensuring a single occurrence per role. -
Avoid copy-pasting landmark sections without modifying labels or IDs.
-
If you need to use the same role more than once (e.g., multiple
<nav>
), provide each with a unique accessible name.
Why it Matters
Screen readers and other assistive technologies use landmarks to help users quickly navigate through content. When landmarks are not uniquely identified:
-
Users can become confused when encountering multiple indistinguishable regions.
-
Navigation aids such as rotor menus or landmark lists may present multiple identical entries, which undermines their usefulness.
-
It becomes difficult for users to understand the layout or structure of a page, especially for those relying solely on keyboard or screen reader navigation.
Unique landmark labels enable a more predictable and accessible browsing experience.
Rule Description
Each landmark region must be uniquely identifiable. This can be achieved either by:
-
Having only one landmark of that type on a page (e.g., one
<main>
). -
Providing unique accessible names when multiple landmarks of the same type exist.
The Algorithm (in simple terms)
-
Find all elements with landmark roles (
main
,banner
,navigation
, etc.). -
For each, extract its role and accessible name (
aria-label
,aria-labelledby
, or implicit text). -
Check that no two landmarks share the exact same combination of role and accessible name.
-
If duplicates exist, flag as a violation.