Skip to content
Latchkey

axe-core "region" all content must be in landmarks in CI

axe-core best-practice rule region found page content that is not inside any landmark (main, nav, header, footer, aside, or an ARIA landmark role). Landmark navigation skips such content.

What this error means

axe reports "region: All page content should be contained by landmarks" and points at a block of markup rendered directly under <body> with no surrounding landmark.

axe-core
region: All page content should be contained by landmarks (moderate)
  Fix any of the following:
    Some page content is not contained by landmarks
  <div class="promo-banner">...</div>

Common causes

Content rendered directly under body

A banner, widget, or stray container sits outside <main>/<nav>/<footer>, so it belongs to no landmark region.

Landmarks wrap only part of the page

The layout wraps most content in landmarks but leaves some sections (a cookie bar, a floating widget) outside them.

How to fix it

Move stray content into a landmark

  1. Identify the block axe flags as outside a landmark.
  2. Move it inside <main>, <aside>, or another appropriate landmark.
  3. Re-run axe to confirm all content is contained.
Layout.jsx
<aside aria-label="Promotions">
  <div class="promo-banner">...</div>
</aside>

Give a container an explicit landmark role

Where a native landmark does not fit, add a role and an aria-label so the section becomes a navigable region.

Component.jsx
<section role="region" aria-label="Announcements">...</section>

How to prevent it

  • Contain all top-level content within landmarks.
  • Give complementary content an aside or labelled region.
  • Run axe on the full page including banners and overlays.

Frequently asked questions

What causes ""region" (content outside landmarks)"?
A banner, widget, or stray container sits outside <main>/<nav>/<footer>, so it belongs to no landmark region.
How do I fix "region" (content outside landmarks)?
Move stray content into a landmark

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card