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

Our fictional Study Circle needs a home page and a session-plan page. Readers should understand its purpose, move between pages and read comfortably on a phone. There is no login, booking or payment. A project brief states what to build and how we will know it works. Keep this brief beside you while working.

Plan the files and content

Keep project-home.html, project-session.html and project-site.css beside each other. Keep the supplied study-desk.svg in the images subfolder. Extract the whole example ZIP to preserve these paths.

Write the actual content before decoration: one clear page heading, a short purpose, the next useful action and a return route. The two pages have different browser titles. Both have a description; replace the general description with a more specific one as your own content grows.

Start with structure

Each page has one h1 and one main area. Nav contains the shared site navigation. An unordered list keeps the navigation items together. Aria-label names this navigation area. Aria-current=page marks only the link for the page being read. It describes the current location; it does not make the link work.

The skip link points to project-main. That id belongs to main. Tabindex=-1 lets that main area receive programmatic or fragment-related focus without adding an extra ordinary Tab stop. Test the skip link with the keyboard rather than assuming its presence proves that focus works everywhere. Each section starts with an h2 describing its content.

Choose the image text

The illustration supports the friendly study setting. Its alt text briefly describes the illustrated desk. The caption connects it to the page topic. If an image adds no information, empty alt may be appropriate instead. Do not use the filename as the description. Width and height reserve a shaped space; CSS lets the image shrink to fit. Check the actual asset dimensions before reusing a different picture.

Read the shared stylesheet

The link in each head loads the same CSS file. A change in that file can affect both pages. Box-sizing:border-box makes declared sizes include padding and borders. Body has a maximum width, comfortable line spacing and space around the content. Main adds a light reading surface. Link underlines stay visible, and focus-visible adds a strong keyboard outline.

The navigation uses flex with wrapping, so links can move to another line. Max-width:100% and height:auto keep an image inside its container while preserving its shape. Overflow-wrap helps long text fit. The media rule reduces padding on smaller viewports; it does not identify a particular phone model. These rules are an introduction to CSS, not the full layout course.

Save the shared CSS file

Save this complete stylesheet as project-site.css. It must be beside both HTML files. Do not paste the CSS into the body as ordinary page text.

project-site.css
* {
  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

First open the home file without styling and check its reading order. Then add the second page and test both navigation links and the return link. Add the image and confirm its path. Add the stylesheet last. If styling fails, inspect the CSS request before changing HTML headings.

Try Tab and Shift+Tab. Use Enter on links. Check the focus outline, skip destination and current-page link. Make the window narrow and zoom in; navigation should wrap and content should remain readable. A short manual check is useful but is not a full accessibility audit.

Improve the project without adding fake features

Add an About page using the same navigation and stylesheet. Update all three navigation lists and mark the right current page in each. Add a small schedule only if the data genuinely belongs in a table. Do not add a Send message button unless you can explain exactly what it does. A working small site is better evidence of understanding than an invented success message.

Follow the idea

Build the website in small steps
  1. 1Plan two pages
  2. 2Connect their navigation
  3. 3Share one stylesheet
  4. 4Test both pages and screen sizes

Working content comes before decoration.

Complete program: project-home.html

Save this as project-home.html. Open it in your browser.

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>
Browser previewDocument title: Study Circle | Home

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.

Expected result: a study-circle home page, illustrated desk, skills list and links to the session plan. With project-site.css present, the content has a narrow reading width and visible keyboard focus.

Complete program: project-session.html

Save this as project-session.html. Open it in your browser.

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>
Browser previewDocument title: Study Circle | Session Plan

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.

Expected result: a session plan with three numbered steps and a home link. The navigation marks Study session as the current page. Both pages share the stylesheet.

Problem and solution

Problem: only one page changes after you edit the design.

Solution: confirm both heads link to exactly project-site.css at the same relative location. Check the requested CSS content and refresh both pages. Do not keep two independently copied stylesheets unless you intend them to differ.

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

  1. Which files form the basic project?
  2. Why share one stylesheet?
  3. What does aria-current=page describe?
  4. Why is the image allowed to shrink?
  5. Add a new About page. Which existing files must change?
  6. Explain your test plan to a friend.
Check your practice answers
  1. project-home.html, project-session.html, project-site.css and the referenced image in its images folder.
  2. A common design change can apply consistently to both pages.
  3. The navigation link for the page currently being read.
  4. Max-width:100% limits its displayed width to the available container width; height:auto keeps its shape.
  5. Update navigation in both existing HTML pages, create the About page and mark the current link appropriately in each.
  6. 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?

It makes the page purpose, structure and navigation easier to check. Styling can then support the content instead of hiding missing information.

Does aria-current create navigation?

No. Href creates the link destination. Aria-current describes which link represents the current page.

Why use a maximum reading width?

Very long lines can be tiring. A flexible maximum width keeps the text comfortable while allowing it to fit smaller windows.

What does this project prove?

It gives practical evidence of document structure, working relative links, shared CSS and basic testing. It does not prove backend, security or complete accessibility expertise.

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.