Final project: build a full page
15 min lesson
- This project combines everything from the course into one complete, accessible, responsive web page.
- You will use document structure, semantic tags, headings, lists, links, images, a table, a form and an interactive details element.
- Think of it as assembling a piece of furniture: every earlier lesson was one part, and now you put them together in order.
- The page is a small bakery site with a header, nav, main, sections, a table, a form, a figure and a footer.
- Each section reuses a rule you already learned: one h1, labeled inputs, alt text, semantic tags and the viewport meta.
- The code also includes an external CSS link and a script tag with defer, so the page stays organized and fast.
- After this lesson you can copy the file, replace the content and publish your own real page.
- Build pages in order: skeleton, then content, then style and script.
- Reuse the rules from earlier lessons: one h1, labeled fields, alt text, semantic tags.
- Validate the finished page with the W3C validator before sharing it.
- You have finished the course; build one small page every week to keep the skills sharp.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sunrise Bakery</title>
<!-- External stylesheet keeps the HTML clean -->
<link rel="stylesheet" href="style.css">
<!-- defer so the script runs after the HTML is parsed -->
<script src="app.js" defer></script>
</head>
<body>
<!-- The header holds the site name and the main navigation -->
<header>
<h1>Sunrise Bakery</h1>
<nav aria-label="Main menu">
<a href="#menu">Menu</a> |
<a href="#prices">Prices</a> |
<a href="#contact">Contact</a>
</nav>
</header>
<!-- The main content of the page -->
<main>
<!-- A short intro section -->
<section id="menu">
<h2>Our menu</h2>
<p>Fresh bread every morning, baked before sunrise.</p>
<ul>
<li>Sourdough loaf</li>
<li>Whole wheat bread</li>
<li>Butter croissant</li>
</ul>
</section>
<!-- A figure with a caption for the hero photo -->
<figure>
<img src="bread.jpg" alt="Freshly baked sourdough loaves on a wooden table" width="480" height="320">
<figcaption>Fresh loaves, ready for the morning rush.</figcaption>
</figure>
<!-- A data table with a caption and header cells -->
<section id="prices">
<h2>Prices</h2>
<table>
<caption>Today's prices</caption>
<thead>
<tr><th>Item</th><th>Price</th></tr>
</thead>
<tbody>
<tr><td>Sourdough</td><td>180</td></tr>
<tr><td>Croissant</td><td>90</td></tr>
</tbody>
</table>
</section>
<!-- A collapsible section that needs no JavaScript -->
<details>
<summary>Do you deliver?</summary>
<p>Yes, within 5 km of the bakery.</p>
</details>
<!-- A labeled form with a required email field -->
<section id="contact">
<h2>Contact us</h2>
<form action="/contact" method="post">
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
<br>
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<br>
<button type="submit">Send</button>
</form>
</section>
</main>
<!-- The footer closes the page with copyright -->
<footer>
<p>© 2025 Sunrise Bakery</p>
</footer>
</body>
</html>What happens: A page titled "Sunrise Bakery" with a header showing the bakery name and a navigation row (Menu | Prices | Contact), a section "Our menu" with a bulleted list, a captioned bread photo, a section "Prices" with a small table, a collapsible "Do you deliver?" section, a "Contact us" form with Name and Email fields and a Send button, and a footer reading "© 2025 Sunrise Bakery".
Breaking it down
head
<meta charset>, viewport, title, link, scriptSets encoding, mobile scaling, the tab title and links CSS and JavaScript. Everything the browser needs before drawing the page.
header & nav
<header><h1>...</h1><nav>...</nav></header>The top area with the site name and the main navigation links. Uses aria-label so screen readers can name the nav.
main & sections
<main><section>...</section></main>Wraps the page's unique content. Each section groups a themed block, like menu or prices.
figure & table
<figure>...</figure> and <table>...</table>A captioned image and a data table with a caption and th headers. Both are meaningful structures, not layout tricks.
details
<details><summary>...</summary>...</details>A built-in collapsible FAQ. Users can open and close it without any JavaScript.
form
<form action="/contact" method="post">Collects name and email. Every field has a label, and the email field uses type=email for a basic check.
footer
<footer>...</footer>The closing area with copyright. It is semantic and easy for tools to recognize.
Lessons used in this project
| Part of page | Lesson |
|---|---|
| Doctype, head, meta | Document structure & meta tags |
| Header, nav, main | Semantic HTML |
| Headings and lists | Text, headings & paragraphs |
| Figure and img | Figure, figcaption & image best practices |
| Table and caption | Tables & data |
| Form and labels | Forms & inputs |
| Details and summary | Interactive elements |
| Viewport and link | Linking CSS & JavaScript |
A helpful analogy
Building this page is like opening a small shop: first the walls and sign (structure and headings), then the shelves and goods (lists, images, table), then the counter where customers ask questions (form), and finally the label on the door (footer).
Nesting rules
- 1.Use one h1 per page, then h2 for each section, then h3 only inside a section.
- 2.Keep header, main and footer as siblings directly inside body, never nested inside each other.
Common mistakes
Using div for every section
Avoid
<div><div><div>Menu</div></div></div>Use instead
<header>, <nav>, <main>, <section>, <footer>Semantic tags give structure for free. Screen readers and search engines understand them; divs tell them nothing.
Skipping labels on the form
Avoid
<input type="email" placeholder="Email">Use instead
<label for="email">Email</label><input id="email" type="email">Placeholders disappear when the user types. Labels are always visible and are announced by screen readers.
Quick tips
- •Run the finished page through the W3C validator; fix errors before sharing it.
- •Copy this file as a starter template and swap the text, image and links for your own project.