Wrap your page's primary content in one main element
Document should have one main landmark is the message for axe's landmark-one-main rule, and it means the page has no main element and no element with role="main". The main landmark lets screen reader users jump straight to the primary content, past the header and menu. Wrap that content, everything between the site header and footer, in a single main element.
What the main landmark does
Landmarks mark the regions of a page, such as the banner, navigation, main content and footer, and Deque's rule page explains that screen reader users can jump to a section by its landmark. W3C's landmark guide says each page should have one main landmark, at the top level rather than inside another landmark.
The HTML main element creates the landmark on its own. MDN's main reference says to prefer it over
role="main"unless you support old browsers, and that a document mustn't have more than one main element without the hidden attribute.
Main landmark markup
| Markup | Result |
|---|---|
<div id="content"> around the page content | Fails. A div isn't a landmark, whatever its id or class says. |
<main> around the content between header and footer | Passes, and it's the markup to prefer. |
<div role="main"> | Passes. Keep it for markup you can't change to a main element. |
| Two visible main elements | Fails a separate rule, landmark-no-duplicate-main, with the message Document should not have more than one main landmark. |
| A main element inside a nav or aside | Fails another rule, landmark-main-is-top-level, with the message Main landmark should not be contained in another landmark. |
Where pages lose their main landmark
Layouts built from divs
A theme that wraps its content in a div with a class like content or container never creates a landmark, however the page looks.
A single-page app's root
Frameworks mount the app into one div, so the main element has to come from your own layout component.
Pages from a second template
Landing pages, error pages and checkout flows can use a layout of their own that leaves out the main element the rest of the site has.
Content inside an iframe
An embedded document follows the same rule. Deque says each iframe should contain either no main landmark or just one.
The messages for landmark-one-main and its sibling rules are in axe-core's message list, and the iframe guidance is on Deque's rule page.
How to add a main landmark
- Open the shared layoutThe fix usually belongs in one place: the layout or template every page uses, between the site header and the footer.
- Wrap the primary contentReplace the wrapping div with a main element, or put a main element around the content. Leave the site header, menu and footer outside it.
- Point your skip link at itGive the main element an id and target it from your skip to main content link.
- Check for a second mainSearch the rendered page for more than one main element or main role, including any added by components or embedded widgets.
- Rerun the rule on each layoutRun axe on a page from every template, since a page built from a different layout can still be missing the landmark.
Frequently asked questions
Does the main element need role=main too?
No. MDN's main reference says the element already behaves as the main landmark and to prefer it over role="main" unless you have to support old browsers.
Is a missing main landmark a WCAG failure?
Not on its own. Deque treats the rule as a best practice with moderate impact. Landmarks are one of the sufficient techniques for WCAG's Bypass Blocks, next to skip links and headings that start each section.
How many sites have a main landmark?
Fewer than half. WebAIM's 2026 Million report found a main element or main landmark on 46.1% of the top million home pages, up from 42.6% in 2025.
Mark up the rest of your page regions
- Website accessibilityFind what stops people with disabilities from using your site.
- Content outside landmarksPut every visible block inside header, nav, main, aside or footer.
- Skip links and keyboard focusLet people bypass repeated navigation and keep keyboard focus easy to follow.
- Skipped heading levelsChoose heading levels for the outline and set their size with CSS.