01
A website can have several pages
One HTML file may be enough for a simple site. Many projects benefit from giving different topics their own pages.
For example, a professional website might have these files.
about.html
services.html
contact.html
Each file represents a different page on the same site.
02
Organise your project
Your project folder might look like this.
├── index.html
├── about.html
├── services.html
├── contact.html
├── styles.css
└── images/
└── project.jpg
All the HTML files can share the same styles.css.
03
Create the About page
Create a new file named:
Start with this structure.
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About | My project</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>About the project</h1>
<p>
Introduce your project here.
</p>
</body>
</html>
04
Link Home to About
From index.html, add this link.
When someone selects it, the browser looks for about.html in the same folder.
To return to Home from about.html, add this link.
05
Reuse the same navigation
Give visitors a way to reach the rest of the site from every page.
Reuse this menu on each page.
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="services.html">Services</a>
<a href="contact.html">Contact</a>
</nav>
06
What is a relative path?
A path tells the browser where to find a file.
When you write this:
you’re using a relative path.
The browser looks for services.html relative to the location of the current document.
07
Link to pages in subfolders
Imagine your project has this structure.
├── index.html
├── styles.css
└── pages/
└── services.html
From index.html, use this link to reach Services.
From services.html, go up one folder to return to Home.
The two dots in:
mean “go up one folder”.
08
Why does a 404 error happen?
A 404 error means the server could not find the requested resource.
Here are some common causes.
The file doesn’t exist.
The file name is misspelt.
The path points to the wrong folder.
The uppercase and lowercase letters don’t match.
09
Keep file names consistent
Use simple, descriptive file names.
Here are some examples.
about-us.html
contact.html
Avoid spaces in file names.
Use a name like this instead.
10
Keep a consistent look across pages
Each page can have different content while still feeling like part of the same site.
Use the same navigation.
Keep the same fonts.
Reuse the colour palette.
Style similar buttons consistently.
Use similar spacing and content widths.
Sharing styles.css makes this easier.
11
Build a simple multi-page site
For practice, create four pages.
about.html
services.html
contact.html
Add this line to the head of each page:
and use the same navigation menu on all four pages.
You now have a small website whose pages visitors can navigate.
12
Check every link
Before publishing, navigate the site as a visitor would.
Home → About.
About → Services.
Services → Contact.
Contact → Home.
Check buttons, images and links to sections too.
SUMMARY
What you’ve learned
- A website can contain several HTML files.
- index.html usually represents the homepage.
- Links connect different pages.
- Relative paths depend on the current file’s location.
- ../ goes up one folder.
- An incorrect path can cause a 404 error.
- Use clear, consistent file names.
- Multiple pages can share one styles.css file.
- Keep navigation consistent across pages.
- Test all links before publishing.
PUT IT INTO PRACTICE
Turn your project into a multi-page site
Use the project you’ve built throughout this course.
- Keep
index.htmlas the homepage. - Create
about.html. - Create
services.html. - Create
contact.html. - Link
styles.cssfrom all four pages. - Add the same navigation menu to each page.
- Check all the paths.
- Visit each page in your browser.
href.