I have a straightforward <nav>
setup with an unordered list inside:
nav {
position: absolute;
right: 0px;
white-space: nowrap;
}
nav ul {
padding: 0;
margin: 0;
}
nav ul li {
clear: both;
white-space: nowrap;
color: white;
display: inline-block;
}
nav ul li a {
color: white;
background: black;
text-decoration: none;
text-align: center;
font-family: statellite;
padding-left: 25px;
padding-right: 25px;
height: 37px;
margin-left: -4px;
padding-top: 18px;
display: inline-block;
}
nav ul li a:hover {
background: #000;
}
nav li a:nth-child(1):hover {
background: red;
}
<nav>
<ul>
<li><a href="#">HOME</a>
</li>
<li><a href="#music">MUSIC</a>
</li>
<li><a href="#livestream">LIVESTREAM</a>
</li>
<li><a href="#links">LINKS</a>
</li>
<li><a href="#about">ABOUT</a>
</li>
</ul>
</nav>
I am attempting to apply a different hover color for each child <a>
,
but all of them end up being highlighted in red.
nav li a:nth-child(1):hover {
background: red;
}
What could possibly be the issue?