edubun
English
1 / 15

10 / 10 · Intro

Build a small page

A complete one-page site for a neighbourhood bakery fits in about 50 lines of HTML, and every element in it comes from the last nine units.

Jump to the 9 practice questions

You will learn

  • Plan the content before writing tags
  • Build a whole page from header to footer
  • Check it like a reviewer: headings, keyboard, validator

Before this: Semantic page structure

1Explain

Plan before you type

Before writing any HTML, write down what the page has to say, in plain words and in order. For a small bakery that might be: the name, a short menu of links, what is baked today, the opening hours, a picture of the bread, a way to sign up for news, and the address.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Corner Bakery</title>
</head>
<body>
  <header>
    <h1>Corner Bakery</h1>
    <nav>
      <ul>
        <li><a href="#today">Today</a></li>
        <li><a href="#hours">Hours</a></li>
        <li><a href="#news">News</a></li>
      </ul>
    </nav>
  </header>
  <main>
    <section id="today">
      <h2>Baked today</h2>
      <ul>...</ul>
    </section>
    <section id="hours">
      <h2>Opening hours</h2>
      <table>...</table>
    </section>
    <section id="news">
      <h2>Get our news</h2>
      <form>...</form>
    </section>
  </main>
  <footer>
    <p>12 Mill Street, Springfield</p>
  </footer>
</body>
</html>

The outline of the finished page, with the details left out.

2Explain

Example: from the plan to elements

Take the plan line by line and pick the element for each part before you write any tags.

  1. The name of the bakery is the main title of the page: h1, inside header.
  2. The short menu of links goes in nav.
  3. Each topic of the page, such as what is baked today and the news sign-up, becomes a section with an h2 and an id for the menu links.
  4. The days and times of the opening hours are rows and columns, so they become a table.
  5. The address goes last, in footer. Only now start typing tags.

3Problem

Where the opening hours go

The opening hours of the bakery belong in

Hint

It is part of the main content of this page.

Solution

Answer: a table

Days and times form rows and columns.

4Problem

The viewport line

Two lines in the head are new. <meta name="viewport" content="width=device-width, initial-scale=1"> tells phones to use the real screen width instead of pretending to be a desktop screen and shrinking the page; the CSS course explains it in the unit on responsive design. The menu is a list of links inside <nav>, which screen readers announce as navigation, list, 3 items.

What does the viewport meta tag do?

Hint

It is about phones and screen width.

Solution

Answer: Makes phones use the real screen width

Without it, phones shrink a desktop-width layout.

5Problem

A link to #hours

A menu link points to #hours. What must exist on the page?

Hint

A hash link needs a matching id.

Solution

Answer: An element with id="hours"

A fragment link jumps to the element with that id.

6Problem

Outside to inside

Order these from outside to inside: body, main, section, h2

  1. body
  2. h2
  3. section
  4. main
Hint

body holds everything that is drawn.

Solution

Answer:

  1. body
  2. main
  3. section
  4. h2

body contains main, which contains sections, each starting with an h2.

7Problem

Testing with the keyboard

When the page is written, go through it the way a careful reviewer would. Read only the headings: do they tell the story of the page? Press Tab from the top: can you reach every link and form field, in a sensible order, and can you see where the focus is? Look at every image: does its alt text say what would be lost without it, or is it empty because the image is decoration?

Which key do you press repeatedly to test keyboard access?

Hint

The key that moves focus from link to link.

Solution

Answer: Tab

Tab moves focus through links and fields in order.

8Problem

What the validator checks

What does the W3C HTML validator check?

Hint

It reads the markup, not the words.

Solution

Answer: That the HTML follows the rules of the standard

The validator reports markup errors such as a stray closing tag or a missing alt. Speed and spelling need other tools.

9Explain

Build it in small steps

Write the page in small steps and look at the result after each one: the skeleton first, then the header and menu, then one section at a time. If something looks wrong, you only have a few new lines to check. On your own computer, save the file as index.html and open it by double-clicking; the browser shows it straight from the disk.

Add one part at a time and look at the preview after each step.

Your code
<!DOCTYPE html>
<html lang="en">
<head><meta charset="utf-8"><title>Corner Bakery</title></head>
<body>
  <header><h1>Corner Bakery</h1></header>
  <main>
    <section id="today"><h2>Baked today</h2><p>Rye and sourdough.</p></section>
  </main>
</body>
</html>
Preview

10Explore

A menu as a list

Both menus work. With the list, a screen reader announces navigation, list, 2 items before reading the links; CSS can still lay the list out in one line.

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

Menu
<header>
  <h1>Corner Bakery</h1>
  <nav><a href="#today">Today</a> <a href="#news">News</a></nav>
</header>
Preview

11Problem

The name of the home page file

You save the bakery home page on your computer. Which file name is the usual one?

Hint

The page mentions it in the step about opening the file on your own computer.

Solution

Answer: index.html

index.html is the usual name for the main page of a folder, and most web servers send it when an address ends with that folder. The .html ending marks the file as HTML.

12Problem

Building in steps

Put the building steps in order.

  1. Add the header and menu
  2. Add the footer
  3. Write the skeleton
  4. Add the sections one at a time
Hint

From the outside in, then from the top of the page down.

Solution

Answer:

  1. Write the skeleton
  2. Add the header and menu
  3. Add the sections one at a time
  4. Add the footer

The skeleton holds everything; then the page is built from top to bottom, looking at the preview after each step.

13Practice

The bakery page

Build the page from the comments. Set lang to en and the title to Corner Bakery. Move the bread picture into the today section and add image alt text. Give the email input the id email, connect its label to it with for="email", and use a submit button.

Checks
  • lang is en on html
  • title
  • header with h1
  • nav link to #today
  • nav link to #news
  • section#today with h2
  • image with alt text
  • list of 3 breads
  • labelled field
  • email input with id
  • button
  • footer
Your code
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
</head>
<body>
  <!-- 1. header: h1 "Corner Bakery" and a nav with links to #today and #news -->

  <!-- 2. main with section id="today": h2, this picture with alt text, a list of 3 breads -->
  <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 80'%3E%3Cellipse cx='60' cy='48' rx='52' ry='26' fill='%23d9a35b'/%3E%3Cpath d='M30 40 l12 -10 M55 36 l12 -10 M80 40 l12 -10' stroke='%23fff3dd' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E" width="120" height="80">

  <!-- 3. section id="news": a form with a labelled email field and a submit button -->

  <!-- 4. footer with the address -->
</body>
</html>
Preview
Hint

Follow the four comments in order. The picture goes inside the today section, and the label for must match the input id.

A solution
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Corner Bakery</title>
</head>
<body>
  <header>
    <h1>Corner Bakery</h1>
    <nav><a href="#today">Today</a> <a href="#news">News</a></nav>
  </header>
  <main>
    <section id="today">
      <h2>Baked today</h2>
      <img alt="A round loaf of bread on a board" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 80'%3E%3Cellipse cx='60' cy='48' rx='52' ry='26' fill='%23d9a35b'/%3E%3Cpath d='M30 40 l12 -10 M55 36 l12 -10 M80 40 l12 -10' stroke='%23fff3dd' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E" width="120" height="80">
      <ul>
        <li>Sourdough</li>
        <li>Rye</li>
        <li>Seeded loaf</li>
      </ul>
    </section>
    <section id="news">
      <h2>News by email</h2>
      <form>
        <label for="email">Email</label>
        <input type="email" id="email" name="email">
        <button type="submit">Subscribe</button>
      </form>
    </section>
  </main>
  <footer>
    <p>12 Mill Street, Springfield</p>
  </footer>
</body>
</html>

14Explain

Common mistakes

Mistake
<nav><a href="#hours">Hours</a></nav>
<h2>Opening hours</h2>
<p>Daily from 7 am.</p>
Fixed
<nav><a href="#hours">Hours</a></nav>
<h2 id="hours">Opening hours</h2>
<p>Daily from 7 am.</p>

A menu link to #hours does nothing until some element has id="hours".

15

Summary

  • Plan the content in order, then pick an element for each part.
  • Skeleton, header with nav, main with sections, footer.
  • Review with headings, Tab, alt text, labels and the W3C validator.

Back to the courseHTML
Full text · The whole lesson as one text

Plan before you type

Before writing any HTML, write down what the page has to say, in plain words and in order. For a small bakery that might be: the name, a short menu of links, what is baked today, the opening hours, a picture of the bread, a way to sign up for news, and the address. Each item then suggests an element. The name is an <h1> in a <header>, the links go in a <nav>, and the hours are a table. The bread list is a <ul>, the sign-up is a form, and the address goes in the <footer>. Planning content first is what professional teams do too; the HTML follows from it.

The finished structure

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Corner Bakery</title>
</head>
<body>
  <header>
    <h1>Corner Bakery</h1>
    <nav>
      <ul>
        <li><a href="#today">Today</a></li>
        <li><a href="#hours">Hours</a></li>
        <li><a href="#news">News</a></li>
      </ul>
    </nav>
  </header>
  <main>
    <section id="today">
      <h2>Baked today</h2>
      <ul>...</ul>
    </section>
    <section id="hours">
      <h2>Opening hours</h2>
      <table>...</table>
    </section>
    <section id="news">
      <h2>Get our news</h2>
      <form>...</form>
    </section>
  </main>
  <footer>
    <p>12 Mill Street, Springfield</p>
  </footer>
</body>
</html>
The outline of the finished page, with the details left out.

Two lines in the head are new. <meta name="viewport" content="width=device-width, initial-scale=1"> tells phones to use the real screen width instead of pretending to be a desktop screen and shrinking the page; the CSS course explains it in the unit on responsive design. The menu is a list of links inside <nav>, which screen readers announce as navigation, list, 3 items. Each menu link points to the id of a section, so the page works as a single scrolling document.

Check it like a reviewer

When the page is written, go through it the way a careful reviewer would. Read only the headings: do they tell the story of the page? Press Tab from the top: can you reach every link and form field, in a sensible order, and can you see where the focus is? Look at every image: does its alt text say what would be lost without it, or is it empty because the image is decoration? Click every label: does it focus its field? Finally, paste the page into the W3C Markup Validation Service at validator.w3.org, which lists mistakes such as unclosed elements or duplicate ids.

The page will look plain: black text on white, blue links, the browser's default fonts. That is fine and even useful. A page with good HTML is already readable on every device, works with a keyboard and a screen reader, and can be printed. The CSS course starts from exactly this kind of page and adds colour, spacing and layout on top, without changing a line of the HTML.

Build it in small steps

Write the page in small steps and look at the result after each one: the skeleton first, then the header and menu, then one section at a time. If something looks wrong, you only have a few new lines to check. On your own computer, save the file as index.html and open it by double-clicking; the browser shows it straight from the disk. To publish it, you upload the same file to a web host, and the server sends it to anyone who asks for the address, the same way the first unit began.

Key points
  • Plan the content in order, then pick an element for each part.
  • Skeleton, header with nav, main with sections, footer.
  • Review with headings, Tab, alt text, labels and the W3C validator.

Practice questions from Build a small page 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