CHAPTER 58 · HTML
Final project: a two-page student website
Combine page structure, links, an image and a shared stylesheet. Build the small version first, then test it like a real visitor.
Download example files (ZIP)Understand the brief
Plan the files and content
Start with structure
Choose the image text
Read the shared stylesheet
Save the shared CSS file
* {
box-sizing: border-box;
}
body {
margin: 0 auto;
max-width: 56rem;
padding: 1.25rem;
font-family: system-ui, sans-serif;
line-height: 1.65;
color: #172b41;
background: #f5f8fc;
}
main {
padding: 1rem;
background: #fff;
border: 1px solid #bfccd9;
border-radius: 0.6rem;
}
a {
color: #174f91;
text-underline-offset: 0.2em;
}
a:focus-visible {
outline: 3px solid #944000;
outline-offset: 4px;
}
nav ul {
display: flex;
flex-wrap: wrap;
gap: 1rem;
padding-left: 1.25rem;
}
img {
display: block;
max-width: 100%;
height: auto;
}
h1,
h2,
p,
a {
overflow-wrap: anywhere;
}
@media (max-width: 36rem) {
body {
padding: 0.75rem;
}
main {
padding: 0.75rem;
}
}Build and test in small steps
Improve the project without adding fake features
Follow the idea
- 1Plan two pages
- 2Connect their navigation
- 3Share one stylesheet
- 4Test both pages and screen sizes
Working content comes before decoration.
Complete program: project-home.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Study Circle | Home</title>
<meta name="description" content="An original student study-club website project." />
<link rel="stylesheet" href="project-site.css" />
</head>
<body>
<h1>A small study circle</h1>
<p><a href="#project-main">Skip to main content</a></p>
<nav aria-label="Study club">
<ul>
<li><a href="project-home.html" aria-current="page">Home</a></li>
<li><a href="project-session.html">Study session</a></li>
</ul>
</nav>
<main id="project-main" tabindex="-1">
<p>A fictional college group practises one web skill each week.</p>
<figure>
<img
src="images/study-desk.svg"
alt="An illustrated desk with study materials"
width="360"
height="220"
/>
<figcaption>A place to practise and compare notes.</figcaption>
</figure>
<section>
<h2>What we practise</h2>
<ul>
<li>Clear headings and useful links</li>
<li>Images with suitable text alternatives</li>
<li>Labelled forms and careful testing</li>
</ul>
</section>
<p><a href="project-session.html">Read the next study-session plan</a></p>
</main>
</body>
</html>This preview shows the example in a browser. Save the complete code in local files to test links between pages and downloads. Same-page section links work here.
Complete program: project-session.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Study Circle | Session Plan</title>
<meta name="description" content="An original student study-club website project." />
<link rel="stylesheet" href="project-site.css" />
</head>
<body>
<h1>Plan a link-check session</h1>
<p><a href="#project-main">Skip to main content</a></p>
<nav aria-label="Study club">
<ul>
<li><a href="project-home.html">Home</a></li>
<li><a href="project-session.html" aria-current="page">Study session</a></li>
</ul>
</nav>
<main id="project-main" tabindex="-1">
<p>This fictional session is a practice plan, not a live event booking.</p>
<section>
<h2>Our three steps</h2>
<ol>
<li>Write down the destination of each link.</li>
<li>Open each destination and check the title.</li>
<li>Repair one broken path and test it again.</li>
</ol>
</section>
<section>
<h2>Bring a small example</h2>
<p>
Save two HTML files in one folder. Give each file a clear heading and a link back to the
other file.
</p>
</section>
<p><a href="project-home.html">Return to the study-circle home page</a></p>
</main>
</body>
</html>This preview shows the example in a browser. Save the complete code in local files to test links between pages and downloads. Same-page section links work here.
Problem and solution
Common mistakes and useful tips
Preserve the images folder during extraction. Use different titles for different pages. Move aria-current when copying navigation to another page. Keep focus outlines visible. Test a new page directly, not only through the home link.
Practice questions
Which files form the basic project? Why share one stylesheet? What does aria-current=page describe? Why is the image allowed to shrink? Add a new About page. Which existing files must change? Explain your test plan to a friend.
Check your practice answers
project-home.html, project-session.html, project-site.css and the referenced image in its images folder. A common design change can apply consistently to both pages. The navigation link for the page currently being read. Max-width:100% limits its displayed width to the available container width; height:auto keeps its shape. Update navigation in both existing HTML pages, create the About page and mark the current link appropriately in each. Check reading order, both link directions, direct opening, image and CSS paths, keyboard focus, skip link, narrow width and zoom.
Interview questions
Why build the content before visual decoration?
Does aria-current create navigation?
Why use a maximum reading width?
What does this project prove?
Quick revision
Plan files and requirements before decoration. Use meaningful structure and connected pages. Share styles and keep links usable. Test paths, keyboard use, narrow screens and zoom.