LESSON 41 OF 120

Build: a header with navigation

Build a header containing the title and primary navigation.

Official sourceWHATWG HTML — headerReviewed: 2026-08-26
STEP 1 · LEARN

How it works

Build a header containing the title and primary navigation. Semantic structure should describe meaning, not visual appearance.

Correct example
<header><h1>Local workshop</h1><nav><a href="#services">Services</a></nav></header>

header groups introductory content for a page or section. Primary navigation is identified separately with nav.

Common mistake
<header><h1>Local workshop</h1><a href="#services">Services</a></header>

The header exists, but the primary link is not grouped in nav, so its navigation role is not expressed in the structure.

STEP 2 · APPLY

Your exercise

Complete the example. Build a header containing the title and primary navigation.

STEP 3 · BUILD

Write and see the result

index.htmlHTML
Safe resultisolated
The draft stays only in this browser.HTML and CSS allowed · scripts and network blocked
STEP 4 · CHECK

What needs to pass

0%not checked
  • The header contains the title.
  • The header contains nav with a link.
Explain the solution logic

Replace the generic container with header and place the primary link inside a nav within it.