Sub topic 3
Structuring a Page with Landmarks
This chapter covers the page-level elements header, nav, main, aside and footer, and how they become landmarks that assistive technology can jump between. It assumes you know basic HTML syntax (tags, attributes, nesting) and can open your browser's developer tools. CSS knowledge helps but is not required.
What a landmark is
A landmark is a named region of a page that a browser exposes to assistive technology. Screen reader users can list the landmarks on a page and jump straight to one, such as the main content. Sighted keyboard users get a similar benefit from some browsers and extensions.
Without landmarks, a page built from anonymous div elements is one flat block. A screen reader user has to listen through the header and navigation on every page to reach the content. Landmarks give that user the equivalent of a visual scan: header at the top, menu on the side, content in the middle.
The five elements in this chapter map to these landmark roles:
| Element | Landmark role | Purpose |
|---|---|---|
| `header` | `banner` (conditions apply) | Site-wide heading area, logo, top navigation |
| `nav` | `navigation` | A set of links for moving around the site or page |
| `main` | `main` | The central content unique to this page |
| `aside` | `complementary` | Content related to, but separate from, the main content |
| `footer` | `contentinfo` (conditions apply) | Copyright, legal links, site-wide closing information |
The "conditions apply" notes matter, and a later section explains them.
A page skeleton
This skeleton replaces anonymous div elements with named regions.
<body>
<header>
<a href="/">Example Site</a>
<nav aria-label="Primary">
<ul>
<li><a href="/articles">Articles</a></li>
<li><a href="/about">About</a></li>
</ul>
</nav>
</header>
<main>
<h1>Latest articles</h1>
<p>Pick an article to start reading.</p>
</main>
<aside aria-label="Related links">
<p>Subscribe to the newsletter.</p>
</aside>
<footer>
<p>© Example Site</p>
</footer>
</body>Each element describes what the region is, not how it looks. You can place the aside on the left, right or bottom with CSS, and its landmark role stays the same.
Each element in detail
header
A header holds introductory content for its nearest ancestor. At the top level, directly inside body, it typically contains the logo, site name and primary navigation. It maps to the banner landmark only in that top-level position.
A header inside an article or section is not a landmark. It introduces that piece of content, for example with a heading and byline. A page can therefore have many header elements but should have only one banner.
nav
Use nav for major blocks of navigation links: the primary menu, a table of contents, or a breadcrumb trail. It is not meant for every group of links. A short row of links inside a paragraph, or a list of social media icons in a footer, usually does not need to be a nav.
Too many navigation landmarks make the landmark list noisy and reduce its value. A good test is whether a user would want to jump directly to this group of links.
main
main wraps the content that is unique to this page. Content repeated across pages, such as the site header, menus and footer, stays outside it.
Rules for main:
- Use exactly one visible
mainper page. - Do not nest it inside
article,aside,footer,headerornav. - Put the page's
h1inside it in most layouts.
A "skip to content" link usually points at main. For that to work, give main an id and link to it.
<a href="#content" class="skip-link">Skip to main content</a>
<header>…</header>
<main id="content">
<h1>Latest articles</h1>
</main>aside
aside is for content tangentially related to the content around it: a sidebar, a pull quote, a glossary note, or related links. If you removed it, the main content would still make sense.
Placement decides the role. A top-level aside is a complementary landmark. An aside nested inside article or section relates to that content and is not always exposed as a landmark unless it has an accessible name.
footer
A top-level footer holds information about the site or page: copyright, contact links, privacy policy. It maps to contentinfo only when it is not inside article, section, aside, main, nav or another sectioning element. A footer inside an article typically holds author or publication details and is not a landmark.
Landmark roles depend on context
The same element can be a landmark in one place and not in another. This table summarizes it.
| Element | Where it sits | Landmark? |
|---|---|---|
| `header` | Directly in `body` | Yes, `banner` |
| `header` | Inside `article` or `section` | No |
| `footer` | Directly in `body` | Yes, `contentinfo` |
| `footer` | Inside `article` or `section` | No |
| `main` | Anywhere valid | Yes, `main` |
| `nav` | Anywhere | Yes, `navigation` |
| `aside` | Top level | Yes, `complementary` |
Browser support for the nested cases has been uneven over the years. Test in the tools you care about, and do not rely on a nested header or footer being ignored or announced.
Labelling repeated landmarks
When a page has more than one landmark of the same type, give each a distinct accessible name. Otherwise a screen reader announces "navigation" twice and the user cannot tell them apart.
<nav aria-label="Primary">
<ul>
<li><a href="/articles">Articles</a></li>
<li><a href="/about">About</a></li>
</ul>
</nav>
<nav aria-label="Breadcrumb">
<ol>
<li><a href="/">Home</a></li>
<li><a href="/articles">Articles</a></li>
</ol>
</nav>This is one of the few places where adding ARIA is the normal practice, because HTML has no native attribute for naming a landmark. Keep labels short and do not include the word "navigation" in them. The screen reader already announces the role, so aria-label="Primary" is read as "Primary navigation".
If a visible heading already names the region, you can reference it instead with aria-labelledby.
<aside aria-labelledby="related-title">
<h2 id="related-title">Related links</h2>
<ul>
<li><a href="/semantics">What semantics means</a></li>
</ul>
</aside>A single landmark of a given type does not need a label. Label only when there are two or more of the same role.
Do not put everything in a landmark
A common instruction is that all page content should live inside a landmark. This helps, because content outside landmarks is easy for screen reader users to miss when they navigate by region. The usual structure is:
- A skip link, which may sit before the header.
- The
headerlandmark. - The
mainlandmark. - Optional
asideandfooterlandmarks.
However, do not wrap every block in a landmark. If everything is a landmark, nothing stands out. Use div and section for ordinary grouping, as the previous chapter on generic containers describes.
Common errors
- Multiple
mainelements. Only one may be visible at a time. If you build a single-page app with several views, hide inactive ones with thehiddenattribute. - Wrapping the whole page in
main. This turns the header and footer into content ofmain, which defeats the purpose. - Using
navfor every list of links. This clutters the landmark list. - Adding
role="banner"orrole="main"to elements that already have those roles. It is redundant and can mask real problems. - Using
headerandfooteronly as styling hooks. They carry meaning. If you only need a styled box, use adiv. - Unnamed duplicate landmarks. Add
aria-labeloraria-labelledby.
Checking your landmarks
You can inspect landmarks without a screen reader. In Chrome and Edge, open the Accessibility pane in devtools and look at the tree for nodes with roles such as banner, navigation and main. Firefox has an Accessibility panel that shows the same tree. Extensions such as Landmarks or axe DevTools list the regions on a page and flag duplicates.
For a quick check, ask three questions:
- Is there exactly one
main? - Does every duplicated landmark type have a distinct name?
- Is the content that repeats across pages outside
main?
Exercise
A page has a top-level header, two nav elements (one for the site menu, one for breadcrumbs), a main, and a top-level footer. The two nav elements have no attributes. What problem does a screen reader user hit, and how do you fix it in markup?
Show answer
The user hears "navigation" twice with no way to tell the two apart. Give each nav a distinct accessible name, for example <nav aria-label="Primary"> and <nav aria-label="Breadcrumb">. The screen reader then announces "Primary navigation" and "Breadcrumb navigation".
Exercise
You place a footer with the author's name and publication date inside an article element. Is it exposed as the contentinfo landmark? Should the page also have a site-wide footer?
Show answer
No. A footer inside an article is not a contentinfo landmark. It describes that article only. The page should still have a separate top-level footer for site-wide information such as copyright and privacy links, and that footer is the contentinfo landmark.
Exercise
A developer wraps the entire body content, including the site header and footer, in a single main element. Why is this a mistake?
Show answer
main should hold only content unique to the page. Wrapping the header and footer puts site-wide repeated content inside main, so users who jump to main hear the navigation again. It also stops the header and footer from being top-level banner and contentinfo landmarks. Move them outside main.