Jayden Freh Jayden Freh - 5 months ago 15
CSS Question

link functions wont work

My code won't work, I am trying to change the color of my links (will add more specs later) but it won't change. The functions are not performed. I tried changing classes, adding id's, but nothing works. Could someone tell me how to fix it please.

CSS



a:link.NB {

color: red;

}

a:visited.NB {

color: blue;

}

a:hover.NB {

color: #green;

}

a:active.NB {

color: #423243;

}

<nav id="N_bar">
<ul>

<li><a class="NB" href="#">Men</a>
</li>
<li><a class="NB" href="#">Women</a>
</li>
<li><a class="NB" href="#">Children</a>
</li>
<li><a class="NB" href="#">Apparel</a>
</li>

</ul>
</nav>




Answer

You have a few problems here.

  • At the end of the CSS styles, you didn't close #M_section
  • #green should be simply green

See fiddle