KodingKaro
HTML · Beginner · Semantic HTML

Page landmarks

Landmarks let readers and assistive technology move directly between major areas of a page.

✓ What you will learn in this topic

  • Explain the purpose of Page landmarks in a real HTML document.
  • Choose and apply the elements shown in both examples.
  • Recognize the specific mistake described in this lesson.

Concept explanation

Header usually contains introductory or navigational content for a page or section. Nav marks a major navigation group, main identifies the central content, and footer contains closing or related information. A page generally has one main element. Landmark elements do not automatically style a page; their benefit is that their purpose is built into the document structure.

Syntax

Use header, nav, main, and footer around the regions whose roles match their meaning.

Example 1: a small page

Each element identifies a page region, and the nav label names its purpose.

<header><a href=\"/\">Open Trail Journal</a></header>
<nav aria-label=\"Primary\"><a href=\"/routes.html\">Routes</a></nav>
<main><h1>Today’s route</h1></main>
<footer><p>Updated weekly</p></footer>

Expected result: The page has a header, named navigation, main content, and footer landmarks.

Example 2: a practical page

The page separates its site identity, navigation, central story, and contact destination.

<header><h1>Harbor Food Guide</h1></header>
<nav aria-label=\"Explore the guide\"><a href=\"/cafes\">Cafes</a><a href=\"/markets\">Markets</a></nav>
<main><h2>Featured this week</h2><p>Three local markets are open on Sunday.</p></main>
<footer><a href=\"/contact\">Contact the editors</a></footer>

Expected result: Readers can scan the guide’s regions and move to its main content or navigation links.

Common mistakes

Do not choose semantic elements for their default appearance; their value comes from the meaning they convey.

Best practices

Use one main landmark for the page’s central content and select article, section, and aside according to the content relationship.

Practice exercise

Refactor a page of generic containers into header, nav, main, article or section, aside where relevant, and footer. Give each section a useful heading.

Lesson summary

  • Landmarks expose meaningful page regions and improve navigation through the document.
  • Use one main landmark for the page’s central content and select article, section, and aside according to the content relationship.

Knowledge check

Which landmark contains the primary content of a page?

Show the explanation

Use main for the unique central content, not for repeated site navigation or footer material.

Practical example

html
<header><a href=\"/\">Open Trail Journal</a></header>
<nav aria-label=\"Primary\"><a href=\"/routes.html\">Routes</a></nav>
<main><h1>Today’s route</h1></main>
<footer><p>Updated weekly</p></footer>

Expected result:

The page has a header, named navigation, main content, and footer landmarks.

Hands-on practice task

Refactor a page of generic containers into header, nav, main, article or section, aside where relevant, and footer. Give each section a useful heading.

In this section

Other lessons in Semantic HTML

Broaden your knowledge

Related learning topics