18/23 - a:nth-child(3) is changing the 2nd child


#1

https://www.codecademy.com/en/courses/web-beginner-en-WF0CF/3/5?curriculum_id=50579fb998b470000202dc8b#

<Although I used a:nth-child(3), the color changed for the 2nd link.

HTML:
<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
    		<a href ="www.google.com">Google<a/> 
    		<a href ="https://www.youtube.com">Youtube</a>
    		<a href ="www.facebook.com">Check it out!</a> 
	</body>
</html>

CSS:
/*Add your CSS below!*/
a:hover {
    text-decoration: none;
}

a:first-child {
    color: #CDBE70;
}
a:nth-child(3) {
    color: #FFc125;
}

The code is changing the 2nd link. Also copied the code to sublime and checked on Chrome - the issue still happened.

Read related issues but couldn't fix it. Does anybody have any insights?


#2

Maybe cause your first Closing link tag isn't closed propperly ?


#3

Hello Ma'am,
I think your first anchor tag closing braces are wrong. Use the following code for reference.


#4

That's it! Thank you!


#5

No Problem bro :smiley: , I also made lots of small mistakes like that so I feel you :stuck_out_tongue:


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.