Practical-02
Objective: To design a responsive landing page for a fictional product/service using HTML
and CSS.
Tools Required:
1. Code Editor (VS Code, Sublime Text, etc.)
2. Web Browser (Chrome, Firefox, etc.)
Steps to Follow:
Step 1: Create Project Structure
Create a new folder for your project and add the following files:
• index.html
• about.html
• features.html
• contact.html
• style.css
Step 2: Write HTML Structure
index.html (Home Page)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Landing Page</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<header>
<h1>Fictional Product</h1>
<nav>
<ul>
<li><a href="About.html">About</a></li>
<li><a href="features.html">Features</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<section>
<h2>Welcome to Fictional Product</h2>
<p>Your one-stop solution for all your needs.</p>
</section>
<footer>
<p>© 2025 Fictional Product. All rights reserved.</p>
</footer>
</body>
</html>
about.html (About Page)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About Us</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<header>
<h1>About Our Product</h1>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="features.html">Features</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<section>
<p>Introducing the best fictional product to solve your problems.</p>
</section>
</body>
</html>
features.html (Features Page)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Features</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<header>
<h1>Product Features</h1>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<section class="feature">
<ul>
<li>Feature 1</li>
<li>Feature 2</li>
<li>Feature 3</li>
</ul>
</section>
</body>
</html>
contact.html (Contact Page)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Us</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<header>
<h1>Contact Us</h1>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="features.html">Features</a></li>
</ul>
</nav>
</header>
<section>
<p>Email: [email protected]</p>
</section>
</body>
</html>
Step 3: Write CSS for Styling and Responsiveness
Open style.css and add the following code:
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
text-align: center;
}
header {
background-color: #333;
color: white;
padding: 20px;
}
nav ul {
list-style: none;
padding: 0;
}
nav ul li {
display: inline;
margin: 0 15px;
}
nav ul li a {
color: white;
text-decoration: none;
}
section {
padding: 50px;
}
footer {
background-color: #333;
color: white;
padding: 10px;
position: absolute;
width: 98.5vw;
bottom: 0;
}
.feature ul{
list-style: none;
}
/* Responsive Design */
@media (max-width: 600px) {
nav ul li {
display: block;
margin: 10px 0;
}
}
Step 4: Test the Page
1. Open each .html file in a web browser.
2. Resize the browser window to check responsiveness.
Conclusion: You have successfully designed a professional, multi-page responsive landing
site using HTML and CSS.