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.
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
- Identify the block axe flags as outside a landmark.
- Move it inside
<main>,<aside>, or another appropriate landmark. - Re-run axe to confirm all content is contained.
<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.
<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.