Lesson 9 of 14 · 9 min

Page structure with semantic HTML

You could build a whole page out of <div> boxes, and many old sites did. But a <div> says nothing about what it contains. Semantic elements describe their role:

Element Use for
<header> the top of the page: logo, title, maybe navigation
<nav> the main navigation links
<main> the page's main content (only one per page)
<article> a self-contained piece: a post, a product, a news story
<section> a themed group of content with its own heading
<aside> side content: tips, related links
<footer> the bottom: copyright, contact, small print
<body>
  <header>
    <h1>Harare Bakes</h1>
    <nav>...</nav>
  </header>
  <main>
    <article>...</article>
  </main>
  <footer>...</footer>
</body>

They look exactly like <div> until you style them. The difference is meaning:

  • Screen readers let blind users jump straight to the navigation or the main content.
  • Search engines understand which part of the page matters.
  • You, six months later, can read the structure at a glance.

Your task

Restructure the page with semantic elements:

  1. A <header> containing the <h1> and the navigation.
  2. A <nav> around the list of links.
  3. One <main> around the two articles, each in its own <article>.
  4. A <footer> around the copyright line.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Harare Bakes</title>
</head>
<body>
  <h1>Harare Bakes</h1>
  <ul>
    <li><a href="#bread">Bread</a></li>
    <li><a href="#cakes">Cakes</a></li>
    <li><a href="#contact">Contact</a></li>
  </ul>

  <h2 id="bread">Fresh bread</h2>
  <p>Baked every morning at five.</p>

  <h2 id="cakes">Celebration cakes</h2>
  <p>Order three days ahead.</p>

  <p>&copy; 2026 Harare Bakes</p>
</body>
</html>

Your page

Discussion

Stuck? Ask here. Be kind, and share hints rather than full answers.

Loading the discussion…