Whenever I try to scroll down, my navbar moves along with the page. Even when I resize the window, it keeps shifting despite using position:fixed
.
What mistake am I making?
nav li:nth-child(1) {
position: fixed;
border: 1px solid #15317E;
font-size: 30px;
list-style-type: none;
font-weight: bold;
text-transform: uppercase;
padding: 10px 10px 10px 10px;
width: 184px;
background-color: #15317E;
top: 20px;
left: 220px;
}
a:link,
a:visited {
text-decoration: none;
color: white;
margin-bottom: 1px;
}
a:hover,
a:active {
color: white;
background-color: #1569C7;
width: 1000px;
}
<nav>
<li><a href="Team.html" title="Team">The Team</a></li>
<li><a href="#Info">Information</a></li>
<li><a href="#div">Community</a></li>
</nav>