Rule

Top-level landmarks

banner, main, contentinfo and complementary landmarks must be top level.

Rule
landmark-top-level
Type
Best practice, not a WCAG requirement. It runs when Best practices is switched on.
Severity
Moderate

What it checks

Banner, main, contentinfo and complementary landmarks are regions of the whole page. The rule fails one that sits inside another landmark, for example an <aside> placed inside <main>.

Elements that are not landmarks in their position are skipped: a <header> or <footer> inside an article, section or similar, and an unnamed <aside> inside sectioning content. An unnamed <form> or <section> is not a landmark either, so what it wraps still counts as top level. Nesting page regions blurs the outline that screen reader users move through by landmark.

Example

Fails

<main>
  <h1>Recipes</h1>
  <aside>
    <h2>Popular this week</h2>
  </aside>
</main>

Passes

<main>
  <h1>Recipes</h1>
</main>
<aside>
  <h2>Popular this week</h2>
</aside>

The engine is tested against both examples.

How to fix it

Move the landmark out to sit beside the others under <body>, or use an element that is not a landmark, such as a <section> or <div>.

Check your own pages

This rule runs in every pour audit: the browser extension, the bookmarklet, the command line and the editor. Get pour, free.