ARIA Landmarks and Semantic HTML: When to Use ARIA

ARIA landmarks and semantic HTML: how header, nav, main, aside, footer, section, form and search map to roles, labeling repeats, and when ARIA is needed.

Executive Summary: Landmarks are the regions screen reader users jump between: banner, navigation, main, complementary, contentinfo, search, form and region. You almost never need ARIA to create them, because HTML elements such as header, nav, main, aside, footer and search map to them automatically. ARIA earns its place elsewhere: naming repeated landmarks, expressing state such as aria-expanded, connecting descriptions, announcing live updates and building custom widgets that have no HTML equivalent. Used where HTML already works, ARIA tends to add bugs rather than remove them.
Page regions labeled header, navigation, main and footer as ARIA landmarks

A team runs an accessibility audit and gets a long list of findings. The fix that arrives in the next sprint adds role="button" to divs, role="navigation" to a nav that already had it, aria-label on paragraphs, and role="main" on two different elements. The audit after that finds more problems than the first one. ARIA was used as a patch over HTML instead of as a complement to it.

ARIA, the W3C’s Accessible Rich Internet Applications specification, is a set of attributes that add or change roles, names, states and relationships in the accessibility tree that browsers expose to assistive technology. Landmarks are a subset of ARIA roles that identify the major regions of a page. Screen readers list them and let users jump between them, which is the non-visual equivalent of glancing at a page’s layout. The elements that produce them are the same ones covered in semantic HTML explained.

What is the first rule of ARIA?

The W3C’s guidance on using ARIA opens with a rule worth memorizing: if a native HTML element or attribute already has the semantics and behavior you need, use it instead of repurposing an element and adding a role. A <button> beats <div role="button">, because the role changes only what assistive technology is told, not how the element behaves. The div still does not receive focus, respond to Enter and Space, or take part in forms.

The consequence is that ARIA misuse is common and costly. WebAIM’s yearly analysis of the top one million home pages has repeatedly found that pages using ARIA have more detected accessibility errors on average than pages without it. ARIA is not the cause by itself; it tends to appear where developers are building custom controls instead of using native ones.

Which HTML elements create landmarks?

Landmark role HTML element Condition
banner <header> Only when not inside article, aside, main, nav or section
navigation <nav> Always
main <main> Always; one visible per page
complementary <aside> At the top level; when nested in sectioning content, give it a name to keep it a landmark
contentinfo <footer> Same scoping rule as header
search <search> Always, in browsers since autumn 2023
form <form> Only when it has an accessible name
region <section> Only when it has an accessible name

The conditions matter. A <header> inside an <article> is just the article’s header, not the page banner; otherwise every blog card would add a banner landmark. A <section> without a name is a generic grouping, not a region, which prevents pages with dozens of sections from flooding the landmark list.

<body>
  <header>                                    <!-- banner -->
    <nav aria-label="Primary">...</nav>       <!-- navigation "Primary" -->
    <search>...</search>                       <!-- search -->
  </header>

  <main>                                      <!-- main -->
    <article>
      <header>...</header>                     <!-- not a landmark -->
      <section aria-labelledby="specs">       <!-- region "Specifications" -->
        <h2 id="specs">Specifications</h2>
      </section>
    </article>
  </main>

  <aside aria-label="Related articles">...</aside>  <!-- complementary -->

  <footer>                                    <!-- contentinfo -->
    <nav aria-label="Footer">...</nav>        <!-- navigation "Footer" -->
  </footer>
</body>

The search landmark is the newest addition; the search element guide covers its fallback for older browsers.

How do you name landmarks with ARIA?

When a page has more than one landmark of the same type, users hear “navigation, navigation, navigation” with no way to tell them apart. Name them:

  • <nav aria-label="Primary">, <nav aria-label="Breadcrumb">, <nav aria-label="Footer">.
  • Prefer aria-labelledby pointing at a visible heading when one exists, so the name stays in sync with the text.
  • Do not include the role in the name. aria-label="Primary navigation" is announced as “Primary navigation navigation”.

Landmark names are one of the few places where adding ARIA to good HTML is routinely necessary.

Which ARIA roles are redundant?

Older tutorials recommend writing <nav role="navigation"> and <main role="main"> “for compatibility”. That was useful around 2012, when some screen reader and browser combinations did not yet map the new HTML5 elements. Every current browser does, so the explicit roles are redundant. They are harmless, but the W3C validator flags them, and they add noise.

Conflicting roles are worse. <ul role="navigation"> replaces the list semantics, so users lose “list, 5 items”. <button role="link"> announces a link that behaves like a button. <h2 role="button"> removes the heading from the outline. Changing an element’s role is almost always a sign that a different element was needed.

When is ARIA genuinely needed?

Need ARIA Example
Name a landmark or control with no visible text aria-label, aria-labelledby Icon-only button, multiple nav elements
Attach hints and errors aria-describedby Password requirements, validation messages
Express state that HTML cannot aria-expanded, aria-pressed, aria-current, aria-invalid Custom disclosure button, toggle button, current page link
Announce changes without moving focus role="status", role="alert", aria-live “Saved”, result counts, form error summaries
Hide decorative content aria-hidden="true" Icons next to text labels
Build widgets HTML lacks role="tablist", combobox, grid, tree Tabs, autocomplete, spreadsheets, file trees

The last row is where ARIA is most powerful and most dangerous. A role is a promise: role="tablist" tells a screen reader user that arrow keys move between tabs. If you add the role without the keyboard behavior described in the ARIA Authoring Practices Guide, you have made a promise the component does not keep. Before building one, check whether a native element now covers the need. Many former ARIA widgets have native replacements: <dialog> for modals, the Popover API for menus and pickers, and <details> for disclosures and accordions, covered in earlier posts on the dialog element, the Popover API and details and summary.

aria-hidden needs care

aria-hidden="true" removes an element and all its descendants from the accessibility tree, but not from keyboard focus. A focusable link inside an aria-hidden container can still receive focus, and screen reader users land on something announced as nothing. Use it for decorative icons and duplicate content only. To hide and disable a whole region, such as the page behind a custom overlay, use the inert attribute, which removes it from both.

Testing landmarks

  1. List them with a screen reader. The NVDA elements list (Insert+F7), VoiceOver’s rotor or JAWS’s landmark list shows every landmark and its name. Each should be meaningful on its own.
  2. Check coverage. All meaningful content should sit inside some landmark, so nothing is skipped by users who jump between them. Content floating between regions is easy to miss.
  3. Inspect the accessibility tree in Chrome or Firefox DevTools to confirm roles and names without a screen reader.
  4. Run an automated checker such as axe for duplicate main, unnamed duplicate landmarks and redundant roles. Automated tools catch structural problems; they cannot judge whether names make sense.

Frequently Asked Questions

What are ARIA landmarks?

Landmarks are ARIA roles that identify the major regions of a page, such as banner, navigation, main, complementary, contentinfo, search, form and region. Screen reader users can list them and jump between them to understand and move around the page quickly.

Do I need role=”navigation” on a nav element?

No. All current browsers map nav to the navigation landmark automatically, and the same is true for main, aside, header, footer and search. Adding the matching role is redundant and validators flag it.

When should I use ARIA instead of HTML?

Use HTML whenever a native element or attribute provides the semantics and behavior you need. Use ARIA to name landmarks and icon-only controls, connect descriptions, express states such as aria-expanded, announce live updates, and build widgets such as tabs or comboboxes that have no native HTML equivalent.

How do I label multiple nav elements?

Give each one a distinct accessible name with aria-label or aria-labelledby, such as Primary, Breadcrumb and Footer. Do not include the word navigation in the name, because screen readers already announce the role.

HTML builds the map, ARIA labels it

Landmarks come almost entirely from choosing the right HTML elements. ARIA’s job is to fill the gaps HTML leaves: names for repeated regions, state for custom controls, announcements for changes and roles for widgets the platform does not provide. Use it there, test with a screen reader’s landmark list, and resist adding it anywhere the native element already speaks for itself. For the full reference, see the W3C ARIA Authoring Practices landmark patterns and the W3C Using ARIA recommendation. Related reading on this site: accessible forms.

Originally posted on 15 October 2024 and post last modified on 15 October 2024

Accessibility ARIA Front-End Development HTML5 Landmarks Semantic HTML

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *