Lesson 32 of 51 · Module 5, lesson 5 of 7 · 4 min

Page landmarks: header, nav, main and footer

Mark the main areas of a page so that everyone, including screen reader users, can find their way.

What you'll learn

  • The landmark elements: <header>, <nav>, <main>, <aside> and <footer>
  • How screen reader users use landmarks to move around a page
  • How to structure a whole page with them

Why this matters

Most pages share the same parts: a top area with the site name, a menu, the main content, and a footer. HTML has an element for each. They are called landmarks, because they work like signs on a map. A screen reader user can list them and jump straight to the main content — instead of listening to the whole menu on every page.

This is what people mean by semantic HTML: choosing elements for what the content is.

The landmarks

A page divided into landmarks. At the top, header holds the site name and logo, with nav inside it for the links Home, Recipes and About. Below, main holds the content of this page — only one per page — containing an article (the tomato soup recipe) with sections for Ingredients and Steps. Then aside holds related content such as other soups or a tip, and footer holds contact details and copyright. Screen readers list the landmarks as banner, navigation, main, complementary and content info, so a listener can jump straight to main.

ElementWhat it holds
<header>The top of the page: site name, logo, often the main navigation
<nav>A group of main navigation links
<main>The main content of this page. Only one per page.
<aside>Content related to the page, but not part of its main flow: tips, related links
<footer>The bottom of the page: contact, copyright, small links

A complete page

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Tomato soup — Home Kitchen</title>
</head>
<body>
  <header>
    <p>Home Kitchen</p>
    <nav>
      <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="recipes.html">Recipes</a></li>
        <li><a href="about.html">About</a></li>
      </ul>
    </nav>
  </header>

  <main>
    <h1>Tomato soup</h1>
    <p>A warm soup for four people, ready in thirty minutes.</p>
  </main>

  <aside>
    <h2>Tip</h2>
    <p>Add fresh basil just before serving.</p>
  </aside>

  <footer>
    <p>Written by Ana Lima. Contact: ana@example.com</p>
  </footer>
</body>
</html>

What you'll see: a plain page from top to bottom: the site name, the menu as a bulleted list, the heading and text, the tip, and the footer text. Landmarks do not change the look — they add meaning.

A plain page: "Home Kitchen", a bulleted menu with Home, Recipes and About, the heading "Tomato soup" with its paragraph, a "Tip" heading with a paragraph, and the footer line "Written by Ana Lima. Contact: ana@example.com".

Rules that keep landmarks useful

  • One <main> per page, holding the content that is unique to that page. The header, navigation and footer (the same on every page) stay outside it.
  • <nav> is for major navigation — the main menu, a table of contents. A single link in a paragraph does not need <nav>.
  • The site name in the <header> is a normal paragraph here, so that the page's one <h1> can be the page's topic.
  • Put the page's <h1> inside <main>.

Checking your landmarks

Your browser can show them. In Chrome or Edge, open the developer tools, select an element, and look at the Accessibility pane: each landmark shows its role, such as "main" or "navigation". You can also install a free landmarks browser extension and list them.

Try it yourself

  1. Select the example and choose Try it.
  2. Add a second link in the footer, and a second tip in the <aside>.
  3. Take one of your own pages (for example about.html) and wrap its parts in <header>, <main> and <footer>.

Common mistakes

  • Two <main> elements. A screen reader cannot tell which is the real content. Fix: one per page.
  • Everything inside <div>s. No landmarks, so no quick navigation. Fix: use the landmark elements.
  • <nav> around every group of links. The landmark list gets long and useless. Fix: only for major navigation.
  • The main heading outside <main>. Fix: put the <h1> inside <main>.

Check yourself

  1. How many <main> elements should a page have?
  2. Where does the main menu usually go?
  3. Do landmarks change how the page looks?

Answers

  1. One.
  2. In a <nav>, usually inside the <header>.
  3. No. They add meaning; the look comes from CSS.

Next: inside <main>, content has its own structure: a whole article, its sections, and side notes. The next lesson covers those elements.

Chat with us on WhatsApp