Nth Child for ul li links
I am trying to get a special style for ul li a elements. Here is the code:
<ul id="menu"> <li><a href="#">One</a></li> <li><a href="#">Two</a></li> <li><a href="#">Three</a></li> </ul> I would like the second link (Two) to have a different style ( color ) than the other two (one and three).
This is what I tried, but it does not work:
#menu li a:nth-child(even) {color:red;}
Any work tips? There is a fiddle here:
Thanks!
+4
2 answers