To make the blog multiple pages, you can create separate HTML files for each page and link them together using anchor tags (<a>
). Here's how you can structure your project:
index.html
, about.html
, contact.html
, etc.htmlCopy code
<!-- index.html -->
<a href="about.html">About</a>
<a href="contact.html">Contact</a>
htmlCopy code
<!-- about.html -->
<a href="index.html">Home</a>
<a href="contact.html">Contact</a>
htmlCopy code
<!-- contact.html -->
<a href="index.html">Home</a>
<a href="about.html">About</a>
index.html
might contain the main blog posts, while about.html
might contain information about the author or the blog itself.<head>
section of each HTML file.Here's a simplified example of the index.html
file:
htmlCopy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Blog - Home</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>My Simple Blog</h1>
</header>
<main>
<section id="blog-posts">
<!-- Blog post content goes here -->
</section>
</main>
<footer>
<p>© 2024 Simple Blog</p>
</footer>
<script src="scripts.js"></script>
</body>
</html>
And here's an example of the about.html
file:
htmlCopy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Blog - About</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>About Us</h1>
</header>
<main>
<section>
<h2>Our Story</h2>
<p>This is where you can tell visitors about your blog or yourself.</p>
</section>
</main>
<footer>
<p>© 2024 Simple Blog</p>
</footer>
<script src="scripts.js"></script>
</body>
</html>
Repeat this structure for each page of your blog. When users click on the links, they'll navigate between the different pages of your blog.