File 2
File 2
implement it using CSS for styling, I'll provide an example that includes the
following sections: Faculty, Courses, Activities, and Contact Us. We will use a
dropdown navigation menu for better user experience.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Department Webpage</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<div class="logo">
<h1>Department of Computer Science</h1>
</div>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<section id="contact">
<h2>Contact Us</h2>
<p>If you have any questions, feel free to reach out to us at
<strong>[email protected]</strong>.</p>
</section>
</div>
<footer>
<p>© 2024 Department of Computer Science. All Rights Reserved.</p>
</footer>
</body>
</html>
CSS (styles.css)
header {
background-color: #333;
color: white;
padding: 20px 0;
text-align: center;
}
header h1 {
margin: 0;
font-size: 2em;
}
nav {
background-color: #333;
}
nav ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
}
nav ul li {
float: left;
width: 150px;
}
nav ul li a {
display: block;
text-align: center;
padding: 14px;
color: white;
text-decoration: none;
background-color: #333;
font-size: 1.2em;
}
nav ul li a:hover {
background-color: #ddd;
color: black;
}
/* Dropdown Menu */
.dropdown {
position: relative;
}
.dropdown .dropbtn {
display: block;
padding: 14px;
color: white;
background-color: #333;
text-align: center;
font-size: 1.2em;
width: 150px;
cursor: pointer;
text-decoration: none;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #333;
min-width: 150px;
box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: white;
padding: 12px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
color: black;
}
.dropdown:hover .dropdown-content {
display: block;
}
/* Content Section */
.content {
padding: 20px;
}
.content h2 {
color: #333;
}
.content p {
font-size: 1.1em;
color: #555;
}
/* Footer Section */
footer {
background-color: #333;
color: white;
padding: 10px 0;
text-align: center;
position: fixed;
width: 100%;
bottom: 0;
}