Pseudo-class selector link and visited are not working,,can u tell me whats wrong in the code


#1







<a href ="http://www.codecademy.com"> Study Site </a> <br>
<a href ="http://www.chetanbhagat.com/books/">Book's </a><br>
<a href ="http://www.indiatvnews.com"> India Tv News </a>

</body>

CSS :
a:first-child
{font-size:22px;
color:#CDBE70;
}

a:nth-child(3)
{color:#FFC125;
}

a:hover
{text-decoration:none;
color:yellow;
}

a:visited
{color:red;}


#2

What do you mean not working? there are a few problems here: nth-child count all elements, so you first link is first element, your break second, your second link third child, the break 4th child and your last link 5th child.

for a:hover to work, it should be after a:visited, the visited is compared to your browser history. Which color are the links? red?


#3

yes .the links shows red color,
and that means nth-child will not work if i am using css for the first-child ..both will not work together ????


#4

a:first-child and a:nth-child(3) only work on links you haven't visited, put in something rubbish (<a href="http://garbishsite.com"> for example) and you will see it work


#5

Yes ,I got it
** Thank you**