Divide a Page Into Landmarks

Rosa’s home page now has a photo that loads without jumping, links, upcoming events, and her contact line. All of it sits inside one <main>, the page’s only landmark. A screen reader user can still move through it by headings and links but has no other regions to jump between yet, such as a header, a menu, or a footer.

In this lesson, you’ll divide the home page into regions: a header with the site’s menu, the main content, a side note, and a footer. Then you’ll open Chrome’s Accessibility pane to check what a screen reader finds. Start with the regions every page of the site shares.

Mark the Page’s Regions

A sighted visitor glances at a page and sees where the site’s name, its menu, and the content are. A screen reader user can’t glance, so screen readers offer a list of the page’s landmarks, the regions users can jump straight to, and a key that moves to the next one. HTML has an element for each common region:

  • <header> introduces the page, for example, with the site’s name.
  • <nav> holds the main links between pages.
  • <main> holds the content that’s unique to this page. A page has exactly one.
  • <aside> holds something related but separate, like a tip.
  • <footer> holds information about the page or site, like contact details.

Rosa’s site needs a menu that links its pages. In index.html, add this header between <body> and <main>:

Language: HTML
<header>
  <p>Elm Street Community Garden</p>
  <nav>
    <ul>
      <li><a href="index.html">Home</a></li>
      <li><a href="plots.html">Plots</a></li>
      <li><a href="about.html">About</a></li>
    </ul>
  </nav>
</header>

Then delete Rosa’s contact line from <main>, and add an aside and a footer after </main>, with the contact line in the footer:

Language: HTML
<aside>
  <p>New to gardening? Rosa shows newcomers around at every work day.</p>
</aside>
<footer>
  <p>
    Questions? Email Rosa at
    <a href="mailto:[email protected]">[email protected]</a>.
  </p>
</footer>

Save and look at your preview, for example, at http://127.0.0.1:3000/index.html. Apart from the site’s name and the bulleted menu at the top and the tip near the bottom, the page looks much as before, because Chrome’s default styles barely touch these elements. They convey meaning to assistive technology, and CSS will control their appearance.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.