18. My code was accepted but didn't reflect?


#1


My code was accepted, but it didn't change the text decoration or change colors? I want to know if i'm doing something wrong or it's a bug??

Thanks everyone!!


<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>Three random sites
		<!--Add your HTML below!-->
		<p> <a href="http://www.espn.com">Link 1</p>
		<p> <a href="http://www.nfl.com">Link 2</p>
		<p> <a href="http://www.fantasypros.com">Link3</p>
		
	</body>
</html>

******
stylesheets.css
*******

a:hover {
    text-decoration:none;
}
a:first-child  {
    color:#CDBE70
}
a:nth-child(3)  {
    color:#FFC125
}


#2

Where are the closing a tags?

Plus,

What this line needs to be?


#3

all anchor elements (<a></a>) are first child of paragraph, so this code (even if you close the anchor elements (</a> is missing)), all the anchors are still first child, you could overcome this problem by using the paragraphs for counting, and then select the anchor elements inside:

p:first-child a
p:nth-child(3)

however, the exercise won't accept this


#4

Hi,

There is in fact a problem if you use something else than only "a" tags ("p", "div", etc...);
However, when you use only "a" tags, (Whithout anything more); it works fine:

Hope that helps

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
		<a href="https://www.google.com/">Google</a>
		<a href="https://www.quant.com/">Quant</a>
		<a href="https://www.yahoo.com/">Yahoo</a>
	</body>
</html>

a:hover {
    text-decoration: none;
}
a:first-child {
   color: #CDBE70;
}
a:nth-child(3) {
    color: #FFC125;
}

#5

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