landmark-one-main

Page should have a main landmark

manualconfidence: mediumseverity: minoroperable

Checks that the page has at least one main landmark (role="main" or <main>).

Applies to. Applicable to any HTML document with a <body> element that is a page of its own (a document shown in a frame is not): "does the page have a main landmark" is a whole-page concern, matching bypass-blocks-present's pattern of evaluating the document directly. Not while a modal dialog is open: the rest of the page is inert then, so the scan sees the dialog, not the page. A custom element whose ElementInternals give it a landmark role (this.attachInternals().role), with no role attribute naming another, is a landmark as a native element with that role is.

Expectation. At least one main landmark (role="main" or <main>), exposed to assistive technology, exists on the page. A page with none gives AT users no landmark to jump straight to for the primary content.

Examples

pass
<body>
<main>Primary content</main>
</body>

A <main> landmark exists.

can't tell
<body>
<header>Site</header>
<p>Primary content, no landmark.</p>
</body>

No <main> or role="main" anywhere on the page.

How to check

When this rule can’t decide, it reports cantTell and leaves the question to a person. Each question it can ask is listed here under its reason code, with the steps to answer it. A finding carries the same steps as howToCheck, in the scan’s language. See Output schema.

LANDMARK_MAIN_MISSING

  1. Open a screen reader's landmarks list, or the Accessibility pane, and look for a main landmark.
  2. Find the page's primary content and inspect its container for a main element or role="main".
  3. If the content is inside an iframe, check the framed document for a main instead.

Pass. A main landmark exists and wraps the page's primary content.

Fail. No main landmark is exposed, so users cannot jump straight to the primary content, a best-practice miss under the WAI-ARIA main role (ARIA11).

View source