Hello @Johani! Your answer on another thread inspired me and helped me get closer to my goal of having a sticky navigation at the top of my site. I’ve got it working now, but was hoping you could take a look at my CSS on my header and offer any feedback on my last post. For some reason, I can’t get the elements centered and evenly spread across my navbar.
My CSS:
/* Style the navigation bar */
.d-header {
margin-top: 45px;
position: fixed;
}
#main {
padding-top: 45px;
}
.navbar {
margin: 0;
width: 100%;
position: fixed;
line-height: 45px;
background-image: linear-gradient(#66ccb4, #2d8671);
z-index: 1001;
box-shadow: 0 1px 4px 0px white;
}
/* Navbar links */
.navbar a {
float: left;
text-align: center;
color: white;
text-decoration: none;
font-size: 1.1em;
width: 19.8%;
}
.rt-border {
border-right: 1px solid #c6ece3;
}
/* Navbar links on mouse-over */
.navbar a:hover {
background-image: linear-gradient(#3aae93, #206051);
}
/* Add responsiveness - will automatically display the navbar vertically instead of horizontally on screens less than the number of pixels defined here */
@media screen and (max-width: 800px) {
.navbar{
display: flex;
}
.navbar span{
display: none;
}
}