# Page Landmarks

> Landmark regions divide a page into named zones that screen reader users can jump between directly. Getting them right is not just about using the right element: it also means labelling identical landmark types so AT can tell them apart, and ensuring a skip link exists so keyboard users can bypass repeated navigation.

Subject: HTML | Lesson 32 of 42 | 6 min read
Interactive lesson: https://codewithanimation.in/html/page-landmarks
Previous: [Semantic Markup vs Div Soup](https://codewithanimation.in/html/semantic-vs-div-soup.md) | Next: [article, section, aside & address](https://codewithanimation.in/html/article-section-aside-address.md)

## What it is

A landmark is a named region of a page that a screen reader user can jump to from a landmark list, without having to read every element in between. The seven landmark roles and their native HTML elements are: `banner` (`<header>` at body level), `navigation` (`<nav>`), `main` (`<main>`), `complementary` (`<aside>`), `contentinfo` (`<footer>` at body level), `search` (`<search>` or `<form role="search">`), and `region` (`<section>` with an accessible name via `aria-label` or `aria-labelledby`).

The `region` landmark is the one most often misunderstood. A `<section>` without an accessible name has no landmark role: the browser assigns it `role="generic"`. Only a named `<section>` becomes a `region` landmark. This means adding `<section>` without a label is no better than a `<div>` for AT landmark navigation.

## Why it matters

Landmark navigation is the primary way screen reader users explore the structure of an unfamiliar page. NVDA users press D to cycle through landmarks. VoiceOver users open the rotor and select Landmarks. JAWS users press R. Each press moves the virtual cursor to the next landmark, announcing its type and label. A well-structured page might be navigable in five keystrokes: banner, navigation, main, region (articles), contentinfo. A div-soup page has no landmarks and the user starts reading from the top.

WCAG 2.4.1 (Bypass Blocks, Level A) requires a mechanism to skip repeated navigation. Landmarks satisfy this requirement because AT can jump past the `banner` and `navigation` directly to `main`. For keyboard users who do not use AT, a skip link serves the same function: a visually hidden `<a href="#main-content">Skip to main content</a>` as the first focusable element on the page.

## How it works

Place exactly one `<main>` on each page. Place the `<header>` and `<footer>` as direct children of `<body>` (or at least not inside other landmarks) to get the `banner` and `contentinfo` roles. Use `<nav>` for all navigation blocks. Give every `<nav>` an `aria-label` if there are more than one: the label becomes the announced name before the role, so AT says "Main, navigation" and "Footer, navigation" instead of "navigation" twice.

For a skip link, add `<a href="#main-content" class="skip-link">Skip to main content</a>` as the very first child of `<body>`. Give the `<main>` element `id="main-content"`. Style the skip link to be visually hidden by default but visible on `:focus` with a high-contrast appearance. Keyboard users who press Tab on page load will hit it first and can activate it to jump past the nav.

Use `<section aria-label="Breaking news">` to create a named `region` landmark for a distinct thematic section within `<main>`. Keep the label short (two to four words). Do not add `aria-label` to every `<section>` mechanically: landmark proliferation makes the list unwieldy. Only name sections that a user would plausibly want to jump to directly.

## Common mistake: Using multiple <nav> elements without aria-label

When a page has a primary navigation and a secondary breadcrumb `<nav>` or footer link `<nav>`, AT lists them all as "navigation" with no way to tell them apart. The user must enter each one to discover its content. Adding `aria-label="Main"` to the primary nav and `aria-label="Breadcrumb"` to the breadcrumb gives the user the information they need before entering. The label appears in the landmark list alongside the role.

## Tip: Audit landmarks with the browser accessibility tree or a screen reader's landmark shortcut

Open DevTools Accessibility panel, find the `<body>`, and expand the accessibility tree. Landmark roles appear as named nodes. Alternatively, install the browser extension for your screen reader of choice and press the landmark shortcut key on a page you built. If the list is empty or shows duplicate unlabelled navigation entries, you have found a real user-facing problem. The audit takes thirty seconds and is more reliable than a visual inspection of the HTML.

## Try it: Try it

Watch a screen reader walk through the page landmarks in order, hearing what gets announced at each stop.

The animation is on the lesson page and is not part of this text version: https://codewithanimation.in/html/page-landmarks

## Check yourself

### Question 1

Does a <section> element without aria-label create a landmark region?

- A. No. An unnamed <section> falls back to role="generic"
- B. Yes. <section> always creates a region landmark
- C. Yes, but only if it is a direct child of <main>

Correct answer: A

A `<section>` without an accessible name has `role="generic"` and is invisible to landmark navigation. Add `aria-label` or `aria-labelledby` to promote it to a `region` landmark.

- Why not B: <section> only maps to role="region" when it has an accessible name via aria-label or aria-labelledby. Without a name, the browser assigns role="generic", which is not a landmark.
- Why not C: Position inside <main> does not change the rule. The accessible name requirement applies regardless of where <section> is placed in the document.

### Question 2

A page has a primary nav and a breadcrumb nav, both using <nav> without aria-label. What does AT announce for each?

- A. "navigation" for both, with no way to distinguish them
- B. "navigation 1" and "navigation 2" automatically
- C. "primary navigation" and "secondary navigation" based on DOM order

Correct answer: A

Without `aria-label`, every `<nav>` is announced simply as "navigation". Add `aria-label="Main"` and `aria-label="Breadcrumb"` so AT users know which is which before entering.

- Why not B: AT does not auto-number identical landmark types. Both are announced as "navigation". The user must enter each one to discover its contents.
- Why not C: There is no automatic labelling based on DOM order. AT announces the role name only. Labels must be provided explicitly with aria-label or aria-labelledby.

### Question 3

A skip link points to href="#content". What must exist on the page for it to work?

- A. An element with id="content"
- B. A <main> element, which is automatically named "content"
- C. A <section> with aria-label="content"

Correct answer: A

A skip link with `href="#content"` navigates to the element that has `id="content"`. Without that id in the document, the link goes nowhere.

- Why not B: <main> does not automatically carry an id. You must explicitly add id="content" (or whatever the href targets) to the element you want the skip link to jump to.
- Why not C: The href fragment targets an element's id attribute, not its aria-label. aria-label="content" has no relationship to the hash #content.

## Remember this

- `<section>` without `aria-label` or `aria-labelledby` has `role="generic"` and is not a landmark.
- Multiple `<nav>` elements must each have a distinct `aria-label` so AT users can tell them apart in the landmark list.
- `<main>` is unique: exactly one per page; it satisfies the WCAG 2.4.1 bypass-blocks requirement.
- A skip link (`<a href="#main-content">`) must be the first focusable element and its target must have a matching `id`.
