0

The CSS rules aren't being applied to the html document.

nav > a {
  color: #ffffff;
}
<nav>
  <ul>
    <li><a href="#">About</a></li>
    <li><a href="#">Store</a></li>
    <li><a href="#">Login</a></li>
  </ul>
</nav>

The expectation is that the color would be white, it isn't it nothing changes.

2

3 Answers 3

5

The > means "direct child" and in your case it's not a direct child. You can use nav a which means "every a in nav"

nav a {
    color: #ffffff;
}
<nav>
  <ul>
    <li><a href="#">About</a></li>
    <li><a href="#">Store</a></li>
    <li><a href="#">Login</a></li>
  </ul>
</nav>

0

Try it

nav > ul > li > a {
    color: #ffffff;
}
0

Your problem is with the >, do this in your css instead:

nav a {
    color: #ffffff;
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.