Main Landmarks

Use semantic HTML5 landmarks (header, nav, main, footer) to create navigable page regions for screen reader users.

beginner
1.3.1 Info and Relationships (Level A)2.4.1 Bypass Blocks (Level A)4.1.2 Name, Role, Value (Level A)
❌

The Bad (Inaccessible)

<div id="wrapper">
  <div id="top">
    <div class="logo">My Site</div>
    <div class="menu">
      <a href="/">Home</a>
      <a href="/about">About</a>
    </div>
  </div>
  <div id="content">
    <p>Welcome to our website!</p>
  </div>
  <div id="bottom">
    <p>&copy; 2024 My Site</p>
  </div>
</div>
βœ…

Accessibility-Ready Code

<body>
  <header>
    <a href="/" class="logo">My Site</a>
    <nav aria-label="Main Navigation">
      <a href="/">Home</a>
      <a href="/about">About</a>
    </nav>
  </header>

  <main>
    <h1>Welcome to our website!</h1>
    <p>Main content goes here.</p>
  </main>

  <footer>
    <p>&copy; 2024 My Site</p>
  </footer>
</body>

The Standard

HTML5 landmark elements (<header>, <nav>, <main>, <footer>, <aside>) create navigable regions. Screen reader users can jump directly to these sections instead of reading the entire page.

WCAG Criteria

  • 1.3.1 Info and Relationships (Level A): Page structure must be programmatically determinable.
  • 2.4.1 Bypass Blocks (Level A): Users must be able to skip repeated content.
  • 4.1.2 Name, Role, Value (Level A): Landmark roles must be exposed to AT.

❌ The Bad (Inaccessible)

What’s Wrong?

  1. No Landmarks: Screen readers see one giant block of content.
  2. No Skip Option: Users must read through the entire header on every page.
  3. ID-Based Styling: #top, #content are for CSSβ€”invisible to screen readers.

βœ… The Good (Accessibility-Ready Code)

Why This Works

  1. Native Roles: <header> = banner, <nav> = navigation, <main> = main, <footer> = contentinfo.
  2. Jump Navigation: Screen readers can list and jump to any landmark.
  3. Unique <main>: Each page should have exactly one <main> element.

Accessibility Checklist

  • Use <header> for the site banner/branding area.
  • Use <nav> for navigation blocks; add aria-label if multiple navs exist.
  • Use exactly one <main> for the primary page content.
  • Use <footer> for site-wide footer content.
  • Use <aside> for complementary content (sidebars).
  • Avoid using <div> where a landmark element would be appropriate.
πŸ“ Perfect Implementation Reference
<header>...</header>
<nav aria-label="Main">...</nav>
<main>
  <h1>Primary Heading</h1>
  ...
</main>
<footer>...</footer>

Technical Deep Dive

The Accessibility Tree

Role: banner (header)
β”œβ”€β”€ Role: navigation, Name: "Main Navigation"
Role: main
Role: contentinfo (footer)

Landmark List

Screen readers provide a landmarks list (e.g., VoiceOver Rotor):

  • Banner: Site header
  • Navigation: Nav blocks
  • Main: Primary content
  • Contentinfo: Footer

Multiple Navigations

When using multiple <nav> elements, add aria-label to distinguish them:

<nav aria-label="Main Navigation">...</nav>
<nav aria-label="Footer Navigation">...</nav>
πŸ§ͺ

Interactive Behavioral Lab

πŸ’»

Interactive Sandbox

LIVE PREVIEW

πŸ”¬ Technical Internals

Understand how this component is processed by the browser and Assistive Technology (AT). This section bridges the gap between visual code and the hidden logic that powers accessibility.

🌲 Accessibility Tree

The data structure used by screen readers to "see" your page. It translates HTML roles and attributes into standardized objects.

βš™οΈ Event Logic

Expected behavioral standards for keyboard navigation and state transitions. Crucial for users who don't use a mouse.

  • Focus: Highlights via :focus-visible
  • Activation: Responds to Enter and Space
  • Role: Identified as Landmark Regions

🌐 Browser & Screen Reader Compatibility

Browser
Screen Reader
Status
🍎 Safari
VoiceOver
βœ“ Safe
πŸͺŸ Chrome
NVDA
βœ“ Safe
πŸͺŸ Edge
JAWS
βœ“ Safe
🦊 Firefox
NVDA
βœ“ Safe
πŸ“± iOS Safari
VoiceOver
βœ“ Safe
πŸ€– Chrome Android
TalkBack
βœ“ Safe