KodingKaro
HTML · Intermediate · Semantic Page Layouts

Compose page landmarks and reusable regions

A consistent landmark structure gives a site a predictable frame while allowing each page to have its own central content.

✓ What you will learn in this topic

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

Concept explanation

A site header and primary navigation can be shared across pages, but each page still needs a clear main region and useful page heading. Multiple nav elements should have distinct accessible labels. A header or footer may belong to the whole page or to a nested article, so its meaning depends on its location. Reuse a pattern because the content role repeats, not simply because the markup can be copied.

Syntax

Use page-level header, nav, main, and footer once where suitable; label additional navigation regions when their purpose differs.

Example 1: a small page

The shared site frame surrounds a page-specific main topic.

<header><a href=\"/\">Learning Pathways</a></header>
<nav aria-label=\"Primary\"><a href=\"/courses\">Courses</a></nav>
<main><h1>HTML foundations</h1></main>

Expected result: A site identity, one primary navigation landmark, and course content are available.

Example 2: a practical page

The article’s header and footer belong to the article, not necessarily to the whole website.

<main>
  <article>
    <header><h1>Accessible forms</h1><p>Updated 7 November</p></header>
    <section><h2>Labels</h2><p>Give every control a name.</p></section>
    <footer><a href=\"/authors\">Written by the learning team</a></footer>
  </article>
</main>

Expected result: A standalone lesson has its own heading, topical section, and attribution region.

Common mistakes

Do not use section as a generic styling wrapper. A section should represent a theme and normally have a heading.

Best practices

Sketch the page outline first, identify its repeated and unique regions, then select semantic elements for the content relationships.

Practice exercise

Outline a course detail page with site navigation, a course introduction, lesson articles, related resources, and contact information. Select semantic elements and explain why each fits.

Lesson summary

  • Landmark names and scope depend on where an element sits in the document.
  • Sketch the page outline first, identify its repeated and unique regions, then select semantic elements for the content relationships.

Knowledge check

Can a header element belong to an article rather than the whole page?

Show the explanation

Yes. Header describes introductory content for its nearest page or sectioning context.

Practical example

html
<header><a href=\"/\">Learning Pathways</a></header>
<nav aria-label=\"Primary\"><a href=\"/courses\">Courses</a></nav>
<main><h1>HTML foundations</h1></main>

Expected result:

A site identity, one primary navigation landmark, and course content are available.

Hands-on practice task

Outline a course detail page with site navigation, a course introduction, lesson articles, related resources, and contact information. Select semantic elements and explain why each fits.

In this section

Other lessons in Semantic Page Layouts

Broaden your knowledge

Related learning topics