edubun
English
1 / 15

9 / 10 · Intro

Semantic page structure

Most pages share the same rough shape: a header, a menu, the main content and a footer. HTML has an element for each, and screen readers let users jump straight to them.

Jump to the 10 practice questions

You will learn

  • Keep div and span for styling hooks only

Before this: Forms basics

1Explain

From div soup to landmarks

For years, pages were built from <div> elements with class names such as header or menu. A <div> is a generic box with no meaning at all, so the class name was the only clue, and only people reading the code could see it. HTML now has elements that say what each region is. Browsers, search engines and assistive technology understand them.

A common page shape. Only the labels are standard; the positions come from CSS and can change on a phone.

2Explain

The main regions

These elements describe meaning, not position. A <nav> does not have to sit at the top, and an <aside> does not have to be on the right; on a phone the aside usually ends up below the main content. Positions come from CSS. Choose the element by asking what the content is, the same way you chose heading levels by structure rather than size.

The preview looks plain: these elements change the meaning, not the look. CSS decides where each region sits.

Your code
<header>
  <h1>Corner Bakery</h1>
  <nav><a href="#bread">Bread</a> · <a href="#visit">Visit</a></nav>
</header>
<main>
  <article><h2>New rye loaf</h2><p>Baked every morning.</p></article>
</main>
<aside><p>Open daily from 7 am.</p></aside>
<footer><p>12 Mill Street</p></footer>
Preview

3Problem

How many main?

How many visible main elements should a page have?

Hint

main holds the one main content of the page.

Solution

Answer: 1

One main holds the content unique to the page.

4Problem

The site menu

Which element holds the site menu?

Hint

Short for navigation.

Solution

Answer: nav

nav marks major navigation.

5Problem

A post that stands alone

The question to ask is whether the piece would make sense on its own somewhere else, for example in a news reader or shared as a link. If yes, it is an <article>. If it only makes sense as part of something larger, like the Ingredients part of a recipe, it is a <section>. Both should normally start with a heading. Articles can contain sections, and a section can contain articles, such as a Latest posts section holding several post cards.

A blog post that could be shared on its own is

Hint

Would it make sense shared on its own?

Solution

Answer: article

article is for self-contained pieces.

6Problem

Ingredients inside a recipe

The Ingredients part of a recipe article is

Hint

It is a part of a bigger piece, not a piece on its own.

Solution

Answer: section

It only makes sense inside the recipe, so it is a section.

7Explore

Same box, different meaning

The preview barely changes. What changes is what the box tells screen readers and search engines: a piece that stands alone, a part of something bigger, a side note, or nothing at all.

Tap a choice: the code and the preview change together.

Element
<article>
  <h2>Rye week</h2>
  <p>A different rye loaf every day.</p>
</article>
Preview

8Explain

div and span still have a place

When no element fits, use <div> for a block and <span> for a few words inside a line. They are useful as hooks for CSS, for example a <div class="cards"> that arranges cards in a grid. The rule is to reach for a meaningful element first and fall back to a generic one only when nothing describes the content. A page made only of divs works, but it hides its structure from everyone who does not look at the code.

Your code
<p>Today: <span style="background:#1466b8;color:#fff;padding:2px 6px">Fresh rye</span></p>
<div style="display:flex;gap:8px">
  <div>Sourdough</div>
  <div>Rye</div>
</div>
Preview

9Problem

What a div means

What does a div mean?

Hint

It is a generic box.

Solution

Answer: Nothing; it is a generic box

div has no meaning; use it when nothing else fits.

10Problem

Regions with a meaning

<header>…</header>
<nav>…</nav>
<main>…</main>
<div class="banner">…</div>
<aside>…</aside>
<footer>…</footer>

How many of these elements give a page region a meaning?

Hint

One of them is a generic box.

Solution

Answer: 5

header, nav, main, aside and footer each say what their region is: 5. The div with class="banner" means nothing by itself; the class only helps CSS.

11Problem

More than one header

Can a page have a header for the site and another header inside an article?

Hint

main is the element limited to one per page.

Solution

Answer: Yes: an article can have its own header

header introduces the part it sits in, so each article can open with its own header, for example its title and date.

12Problem

Address and copyright

The address of the shop and the copyright line sit at the bottom of every page. Which element holds them?

Hint

It is the closing region of the page.

Solution

Answer: footer

footer holds information about the page or site, such as contact details and copyright. aside is for side notes, nav for menus.

13Practice

Replace the divs

Replace the divs with semantic elements: header, nav, main, article, aside and footer.

Checks
  • header with h1
  • nav with 3 links
  • article inside main
  • aside
  • footer
Your code
<div class="header">
  <h1>Corner Bakery</h1>
  <div class="menu">
    <a href="#bread">Bread</a>
    <a href="#cakes">Cakes</a>
    <a href="#visit">Visit</a>
  </div>
</div>
<div class="content">
  <div class="post">
    <h2>New rye loaf</h2>
    <p>From Monday we bake a dark rye every morning.</p>
  </div>
</div>
<div class="sidebar">
  <p>Open daily from 7 am.</p>
</div>
<div class="bottom">
  <p>12 Mill Street</p>
</div>
Preview
Hint

header→header, menu→nav, content→main, post→article, sidebar→aside, bottom→footer.

A solution
<header>
  <h1>Corner Bakery</h1>
  <nav>
    <a href="#bread">Bread</a>
    <a href="#cakes">Cakes</a>
    <a href="#visit">Visit</a>
  </nav>
</header>
<main>
  <article>
    <h2>New rye loaf</h2>
    <p>From Monday we bake a dark rye every morning.</p>
  </article>
</main>
<aside>
  <p>Open daily from 7 am.</p>
</aside>
<footer>
  <p>12 Mill Street</p>
</footer>

14Explain

Common mistakes

You may meet the role attribute, part of a W3C standard called WAI-ARIA, written as <div role="navigation">. It gives a generic element a meaning for assistive technology. The W3C guidance on using ARIA starts with a simple rule: if a native HTML element already has the meaning you need, use it instead. <nav> is shorter, works everywhere and cannot be forgotten in one place and remembered in another.

Mistake
<div role="navigation">
  <a href="#bread">Bread</a>
</div>
Fixed
<nav>
  <a href="#bread">Bread</a>
</nav>

When a native element exists, use it: nav already means navigation, with no role needed.

15

Summary

  • header, nav, main, article, section, aside and footer name the regions of a page.
  • Choose by meaning; CSS decides position.
  • Use div and span only when no meaningful element fits.

Next unitBuild a small page
Full text · The whole lesson as one text

From div soup to landmarks

For years, pages were built from <div> elements with class names such as header or menu. A <div> is a generic box with no meaning at all, so the class name was the only clue, and only people reading the code could see it. HTML now has elements that say what each region is. Browsers, search engines and assistive technology understand them. Screen reader users can open a list of these regions, called landmarks, and jump to the one they want, the same way sighted users glance at the layout.

A common page shape. Only the labels are standard; the positions come from CSS and can change on a phone.

The main regions

  • <header>: introductory content, usually the site name or logo and often the main menu. An article can have its own header too.
  • <nav>: a block of major navigation links, such as the site menu or a table of contents. Not every group of links needs one.
  • <main>: the content that is unique to this page. Use exactly one visible <main> per page, and do not put it inside header, nav, aside or footer.
  • <article>: a self-contained piece that would make sense on its own, such as a blog post, a news story or a product card.
  • <section>: a thematic part of a page or article, normally with its own heading.
  • <aside>: content related to the main content but separate from it, such as a sidebar, a glossary box or related links.
  • <footer>: closing information such as the author, copyright and contact links.

These elements describe meaning, not position. A <nav> does not have to sit at the top, and an <aside> does not have to be on the right; on a phone the aside usually ends up below the main content. Positions come from CSS. Choose the element by asking what the content is, the same way you chose heading levels by structure rather than size.

article or section?

The question to ask is whether the piece would make sense on its own somewhere else, for example in a news reader or shared as a link. If yes, it is an <article>. If it only makes sense as part of something larger, like the Ingredients part of a recipe, it is a <section>. Both should normally start with a heading. Articles can contain sections, and a section can contain articles, such as a Latest posts section holding several post cards.

div and span still have a place

When no element fits, use <div> for a block and <span> for a few words inside a line. They are useful as hooks for CSS, for example a <div class="cards"> that arranges cards in a grid. The rule is to reach for a meaningful element first and fall back to a generic one only when nothing describes the content. A page made only of divs works, but it hides its structure from everyone who does not look at the code.

A quick test: open your page with CSS switched off, or read the outline of headings and landmarks a browser extension shows you. If the page still reads in a sensible order, with a clear header, menu, main content and footer, the structure is doing its job.

Native elements before ARIA

You may meet the role attribute, part of a W3C standard called WAI-ARIA, written as <div role="navigation">. It gives a generic element a meaning for assistive technology. The W3C guidance on using ARIA starts with a simple rule: if a native HTML element already has the meaning you need, use it instead. <nav> is shorter, works everywhere and cannot be forgotten in one place and remembered in another. The same idea applies to buttons: a real <button> can be focused with Tab and pressed with Enter or Space for free, while a clickable <div> needs extra code to do the same.

Key points
  • header, nav, main, article, section, aside and footer name the regions of a page.
  • Choose by meaning; CSS decides position.
  • Use div and span only when no meaningful element fits.

Practice questions from Semantic page structure on edubun

Embed this quiz

Free to embed. Please keep the credit line.

Sources for this course (9)
  • WHATWG, HTML Living Standard (html.spec.whatwg.org, checked 2026-10-17)
  • MDN Web Docs, Learn web development: Structuring content with HTML, and the HTML element reference (developer.mozilla.org/en-US/docs/Learn_web_development/Core/Structuring_content and developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements, checked 2026-10-17)
  • MDN, HTML images (alt text guidance, checked 2026-10-17)
  • W3C WAI, Images tutorial and alt decision tree (w3.org/WAI/tutorials/images/decision-tree, checked 2026-10-17)
  • CERN, A short history of the Web (home.cern/science/computing/the-birth-of-the-web/short-history-web/, checked 2026-10-17)
  • W3C and WHATWG memorandum of understanding, 28 May 2019 (w3.org/2019/04/WHATWG-W3C-MOU.html, checked 2026-10-17)
  • W3C, Using ARIA, first rule of ARIA use (w3.org/TR/using-aria/, checked 2026-10-17)
  • W3C Markup Validation Service (validator.w3.org, checked 2026-10-17)
  • MDN, Viewport meta element (checked 2026-10-17).

Checked: 2026-10-17