engler-labs/static-old2/css/styles2.css
2025-02-26 11:56:11 +01:00

85 lines
1.4 KiB
CSS

* {
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
}
.navbar {
background-color: #333;
color: white;
padding: 0.5rem 1rem;
position: relative; /* Ensure the navbar remains anchored */
}
.navbar-container {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
position: relative; /* Key to make dropdown align properly */
}
.logo {
font-size: 1.5rem;
text-decoration: none;
color: white;
}
.nav-links {
list-style: none;
display: flex;
gap: 1rem;
position: absolute; /* Align it below the navbar */
top: 100%; /* Start right below the navbar */
left: 0;
width: 100%; /* Full width of the navbar */
background-color: #444;
flex-direction: column;
overflow: hidden;
height: 0;
visibility: hidden;
opacity: 0;
z-index: 10; /* Ensure it's on top */
}
.nav-links.active {
height: auto; /* Expand naturally */
visibility: visible;
opacity: 1;
}
.nav-links a {
padding: 0.5rem 1rem;
text-align: center;
text-decoration: none;
color: white;
transition: background-color 0.3s ease;
}
.nav-links a:hover {
background-color: #555;
}
.menu-toggle {
display: none;
font-size: 1.5rem;
color: white;
background: none;
border: none;
cursor: pointer;
}
/* Responsive Styles */
@media (max-width: 768px) {
.menu-toggle {
display: block;
}
.nav-links {
display: flex;
}
}