
HTML is the language that structures every page on the web, and its linking capability is what turns those pages into a website. Once you know how to create a single link, the next step is to link multiple pages together into a cohesive, navigable site. This involves organizing files sensibly, building shared navigation, handling paths across folders, and making sure visitors always know where they are. In this guide, you will build a small multi-page website using plain HTML and CSS, learning the techniques that professional developers use to connect pages reliably and accessibly.
How AAMAX.CO Supports Businesses With Web Development
Hand-coding a small site is a fantastic learning experience, but businesses often need sites that are scalable, fast, and optimized for search engines. For that, many organizations hire AAMAX.CO. They are a full service digital marketing company offering web development, digital marketing, and SEO services worldwide. Their team writes clean, semantic HTML and builds robust navigation systems, and they also provide advanced web application development when your project needs dynamic features beyond static pages.
Step 1: Organize Your Project Folder
A clear folder structure makes linking much simpler. Here is a common layout for a small site:
my-website/
index.html
about.html
services.html
contact.html
blog/
index.html
first-post.html
css/
styles.css
images/
logo.pngUse lowercase file names with hyphens instead of spaces. This prevents case-sensitivity issues on web servers and keeps URLs clean.
Step 2: Create a Shared Page Template
Each page should share the same basic structure, including a header with navigation, a main content area, and a footer.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>About | My Website</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<header>...navigation...</header>
<main>...page content...</main>
<footer>...footer links...</footer>
</body>
</html>Notice that even the stylesheet is linked using the link element, another form of connecting files together.
Step 3: Build the Navigation Bar
Inside the header, add a navigation list that links to every main page.
<nav aria-label="Main navigation">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html" aria-current="page">About</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="blog/index.html">Blog</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>Copy this navigation to every page, updating the aria-current="page" attribute so it marks the page the visitor is currently viewing.
Step 4: Handle Links From Subfolders
Pages inside the blog folder need adjusted paths. From blog/first-post.html, a link to the home page must go up one level:
<a href="../index.html">Home</a>
<a href="../css/styles.css">...</a>
<a href="index.html">All blog posts</a>Alternatively, use root-relative paths that start with a slash, such as /about.html. These work from any folder, but they require the site to run on a web server rather than being opened directly from your file system. Many developers use a local development server, such as the Live Server extension in Visual Studio Code, to test root-relative links.
Step 5: Style the Navigation and Active Link
Use CSS to turn the list into a horizontal menu and highlight the current page.
nav ul {
display: flex;
gap: 1.5rem;
list-style: none;
padding: 0;
}
nav a[aria-current="page"] {
font-weight: bold;
text-decoration: underline;
}Styling based on aria-current keeps the visual indicator and the accessibility information perfectly in sync.
Step 6: Add Footer and Contextual Links
The footer is a good place for secondary links such as privacy policy, terms, and social media. Within page content, link related pages naturally. For example, an About page might say, "Explore our services to see how we can help." These contextual links keep visitors engaged and strengthen internal linking for SEO.
Step 7: Add Breadcrumbs for Deeper Pages
For pages nested in folders, breadcrumbs help visitors understand their location.
<nav aria-label="Breadcrumb">
<ol>
<li><a href="../index.html">Home</a></li>
<li><a href="index.html">Blog</a></li>
<li aria-current="page">First Post</li>
</ol>
</nav>Avoiding Repetition as Your Site Grows
Plain HTML requires copying navigation to every page, which becomes tedious on large sites. Developers often solve this with static site generators like Eleventy or Astro, server-side includes, or frameworks such as Next.js, which let you define navigation once and reuse it everywhere. Starting with plain HTML, however, gives you a deep understanding of how linking actually works.
Testing Your Links
Click through every link on every page, including links from subfolders. Check the browser console and network tab for 404 errors. Validate your HTML with the W3C validator to catch typos in attributes, and use a link checker before publishing.
Best Practices Summary
- Use semantic elements like
nav,header, andfooter. - Keep navigation identical in position and order across pages.
- Mark the current page with
aria-current. - Write descriptive link text that makes sense out of context.
- Choose one path style and use it consistently.
Conclusion
Linking web pages together in HTML is the foundation of every website. With a clean folder structure, a shared page template, consistent navigation, and careful handling of relative paths, you can build a multi-page site that is easy to use and easy to maintain. Add breadcrumbs, contextual links, and accessible styling, and your hand-coded site will feel as polished as one built with any professional tool.