Check out this JSFiddle I put together to showcase the structure of my webpage using HTML and CSS:
I've been working on a page that has a sticky navigation bar which stays at the top while the rest of the content scrolls. However, when I try to use position:fixed on the .nav class, it messes up the background color and text alignment. Here's a snippet of my CSS:
.header {
text-align: center;
}
.nav {
position: fixed;
}
.nav ul {
padding: 0;
margin: 0;
list-style: none;
/* display: block; */
background-color: #eee;
}
.nav li {
display: inline-block;
padding: 0 10px;
}
I've seen some solutions online, but I'm struggling to implement them in my scenario. Any suggestions or thoughts?