smartyfy.mrindigi.com

Web Development Pro | Lesson 005 | Build a Small Multipage Website

Web Development Pro · Lesson 05 of 60

Module 1: HTML foundations

In this lesson

Prerequisites and learning outcomes

Complete lesson 4 first. This lesson builds on relative paths and consistent navigation. By the end, you can connect a home page and event page with working links and clear orientation. Plan 10–15 minutes for the core explanation and additional time for the worked practice.

Turn separate files into a small website

A single page can advertise one event, but a small site often needs a home page, a schedule, and practical information. The challenge is not the number of files. It is helping a visitor understand where they are and how to get somewhere else. Consistent navigation, clear page titles, and predictable paths are the foundation of that experience.

This lesson builds a two-page prototype using only HTML and supplied local assets. There is no deployment step and no registration service. The result should work from a practice folder without depending on someone else's image server. Keeping dependencies local makes the example repeatable and makes broken paths easier to diagnose.

Plan files before writing links

Use a workshop-site folder containing index.html, schedule.html, and an images subfolder. Each HTML document contains its own complete document skeleton. The filename index.html is a common default entry document when served from a directory, but direct file opening does not magically create the other pages. Those destination files must actually exist.

A file tree is a map for the developer. Navigation is a map for visitors. They need not expose every implementation detail. A visitor can see “Workshop schedule” while the underlying filename is schedule.html. Prefer stable, understandable filenames so that both maps remain manageable. Avoid naming pages final2.html or new-final.html when their roles are already known.

workshop-site/
  index.html
  schedule.html
  images/
    repair-tools.svg

From either HTML file, images/repair-tools.svg resolves to the same local asset because the two documents share a directory. If you move schedule.html into events/, its relative image path changes unless you adjust the layout. Moving files is therefore a link-maintenance change, not merely housekeeping.

Give each page a clear identity

The home page introduces the workshop and directs readers toward the schedule. The schedule page lists session details. Use distinct titles such as “Repair Workshop | River Community” and “Workshop Schedule | River Community,” plus a visible h1 on each page. Repeated site branding can remain in the header, but it should not replace the page-specific heading.

<nav aria-label="Main">
  <a href="index.html">Home</a>
  <a href="schedule.html" aria-current="page">Workshop schedule</a>
</nav>
<main>
  <h1>Workshop schedule</h1>
  <section id="morning">
    <h2>Morning sessions</h2>
    <p>Bicycle basics begins at 10:00.</p>
  </section>
  <p><a href="index.html">Read the workshop introduction</a>.</p>
</main>

This is the schedule page's body fragment. The accompanying example provides complete pages. On the home page, move aria-current="page" to the Home link instead. It tells assistive technology which link represents the current page; it does not create a visual style by itself. Later CSS can add an underline or other visible cue that does not rely on color alone.

Keep repeated navigation genuinely consistent

Put the same destinations in the same order on both pages. Visitors should not have to relearn the menu after every click. The current-page marker changes, but the route labels stay stable. In a larger system a template could generate repeated navigation; for this small exercise, copy it carefully and review both copies after edits.

A navigation link can point to schedule.html#morning when the destination includes id="morning". This is useful when a visitor asks specifically about morning sessions. Still keep the general schedule link when the whole page is useful. Do not force every route through the home page if a direct destination better matches the reader's task.

Test a complete visitor journey

Begin with both files closed. Open index.html and confirm its title, heading, and introductory sentence. Follow the schedule link, read the destination heading, then return home through the menu. Next open schedule.html directly. A website should not depend on a previous page having been visited unless that dependency is an intentional application design.

Use the keyboard to reach each link and activate it with Enter. Check that focus is visible using the browser's default styles. We have not introduced custom CSS yet, so do not remove outlines. Also inspect the source for duplicate ids and the link paths for capitalization mismatches. A path that works on one local filesystem can fail on a case-sensitive server.

A static link check can confirm that a relative destination file exists and its fragment is present. It cannot establish that the destination is the right one for the link label, nor can it prove the browser's visual layout is usable. Record both the automated result and the manual checks still needed. Honest evidence is more valuable than a blanket “everything tested” claim.

Keep the prototype maintainable

Add a brief README beside the pages explaining how to open them and that all event information is fictional. Document the folder layout and any known limitations, such as the absence of real form submission. This small handoff helps someone else repeat your work without searching through your editor history. It also prevents a demonstration page from being mistaken for a live service.

Worked practice

Worked exercise 1: Move a page safely

Task: Move schedule.html into an events folder while leaving the home page and images where they are. Worked answer: the home link becomes events/schedule.html; the schedule page's home link becomes ../index.html; its image reference becomes ../images/repair-tools.svg. Recheck links in both directions after moving the file.

Worked exercise 2: Correct current-page state

Task: Both pages mark Home with aria-current="page". Worked answer: leave that marker on Home only in index.html and move it to Workshop schedule in schedule.html. The marker describes the current document, so copied navigation needs this one deliberate difference.

Worked exercise 3: Diagnose a broken direct visit

Task: The schedule seems fine when linked from home, but its source file lacks a title and doctype. Worked answer: make it a complete HTML document instead of relying on the home page's structure. Each navigation loads a new document with its own metadata and body; one page does not donate its head to another.

Knowledge check

Question 1

What must schedule.html contain when opened as its own page? A) Only the fragment linked from the home page. B) Its own complete document structure. C) Only the main element, because the home page supplies metadata. D) Only the shared navigation, because the browser supplies page-specific titles.

Check question 1: answer and explanation

Answer: B. Each page is an independent document.

Question 2

What does aria-current="page" indicate? A) The page that will open in a new tab. B) The default page for all links in the menu. C) The current page in a set of links. D) The link that currently has keyboard focus.

Check question 2: answer and explanation

Answer: C. It communicates orientation without changing the destination.

Question 3

Why keep navigation order consistent? A) It reduces relearning between pages. B) It makes the browser resolve every path from the home page. C) It ensures copied current-page markers are correct. D) It removes the need for page-specific headings.

Check question 3: answer and explanation

Answer: A. Predictability helps visitors follow familiar routes.

Question 4

From events/schedule.html, which path reaches a sibling parent-folder index.html? A) index.html. B) ./index.html. C) events/index.html. D) ../index.html.

Check question 4: answer and explanation

Answer: D. Two dots move up one directory before selecting the file.

Question 5

What does a static local-link check establish? A) That every link label accurately describes its destination. B) That referenced local targets exist under its checks. C) That focus is visually clear along the whole journey. D) That the event details on each destination are current.

Check question 5: answer and explanation

Answer: B. Existence is useful evidence with a narrower scope than full usability testing.

Sources and further reading