Move stray content into your page's landmarks

All page content should be contained by landmarks is the message for axe's region rule, and it means some visible content sits outside every landmark, the regions such as header, nav, main, aside and footer that screen reader users jump between. Content outside them is hard to find and its purpose can be unclear. It shows up when a banner, notice or widget is inserted straight into the body, above the header or below the footer, and the fix is moving each one into the landmark it belongs to.

HTML elements that create landmarks

ElementLandmark
<header>Banner, when it isn't inside an article, aside, main, nav or section element.
<nav>Navigation.
<main>Main, one per page.
<aside>Complementary.
<search>Search.
<footer>Contentinfo, under the same condition as the header.
<section> or <form>Region or form, but only once it has an accessible name, for example from aria-label. W3C's landmark guide lists each of these mappings.

What the region rule leaves alone

  • Skip links

    A skip link at the top of the body passes outside a landmark, as long as the element it points to exists.

  • Live regions and alerts

    Content inside an element with aria-live set to polite or assertive, or with the alert, log or status role, counts as contained. A toast message built that way passes.

  • Dialogs

    axe treats a dialog element, or an element with the dialog or alertdialog role, as a container for this rule, so a modal added at the end of the body passes.

  • Hidden content and buttons

    Content hidden from screen readers is skipped, and so are buttons, such as a floating button that opens a chat.

These exceptions come from axe-core's region check and its settings.

Find where the stray content comes from

  • axe's region check reports the outermost block that sits outside a landmark, so one result can stand for a whole banner. Start with what lands directly in the body: announcement bars above the header, cookie banners, newsletter pop-ups and chat widgets added by scripts, and copyright lines placed after the footer.

  • Third-party scripts are the hard case, because they insert their markup at the end of the body where your layout can't wrap it. See whether the script lets you choose the container it renders into, or whether its markup can use the dialog or status role that matches what it does.

How to fix content outside landmarks

  1. Sort the flagged blocks by sourceEach result is a block outside every landmark. Note whether it comes from your own templates or from a script you've added.
  2. Move template content into a landmarkA site-wide notice belongs in the header, a copyright line in the footer and anything about the page itself in main.
  3. Give a standalone block its own landmarkIf a block fits none of those, use an aside, or a section with an accessible name.
  4. Use the right role for widgetsA modal belongs in a dialog element and a short-lived message in a status region. Each describes what the widget does and keeps it from failing this rule.
  5. Test with banners open and closedRerun axe before and after accepting the cookie banner and with any pop-up showing, since each state can add or remove content.

Frequently asked questions

Is content outside landmarks a WCAG failure?

No. Deque treats the region rule as a best practice with moderate impact. It still matters to people who move through a page by landmarks, since anything outside them is easy to miss.

Should header, nav and footer also get role attributes?

There's no need. Deque's region page notes that ARIA best practices call for the native HTML landmark elements over ARIA roles where possible, and those elements create the landmarks on their own.

How many sites use landmarks?

Most use at least one. WebAIM's 2026 Million report found a landmark region on 84.3% of the top million home pages, but a main landmark on only 46.1%.