Text-decoration to none


#1

When trying to do this exercise the 'text-decoration: none;' doesn't seem to work. When trying to submit the code I get the following message:

"Oops, try again. Did you remember to set your link's text-decoration to none;?"

The code looks perfectly fine to me, I even used a couple online compilers to check for syntax errors. But I didn't find any.
I've had this issue before, in 7.CSS: An Overview: 26/26, that time I had fogotten a closing bracket.

I really don't know what's going wrong here, does andybody have an idea?

The HTML:

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>About Me</title>
	</head>
	<body>
		<img src="https://s3.amazonaws.com/codecademy-blog/assets/46838757.png"/>
		<p>We're Codecademy! We're here to help you learn to code.</p><br/><br/>
		<div>
			<a href="https://www.facebook.com"><span>Facebook</span></a>
		</div>
	</body>
</html>

The CSS:

img {
	display: block;
	height: 100px;
	width: 300px;
	margin: auto;
}

p {
	text-align: center;
	font-family: Garamond, serif;
	font-size: 18px;
}

/*Start adding your CSS below!*/

div {
    height: 50px;
    width: 120px;
    border-color: #6495ED;
    background-color: #BCD2EE;
    border-width: 2px;
    border-style: solid;
    border-radius: 5px;
    margin: auto;
    text-align: center;
}

span {
    text-decoration: none;
    color: white;
    font-family: Arial Black;
}

#2

you set your span's text-decoration to none, that is not your link. I will leave it to you, to come up with the correct css selector


#3

Thanks, it works now. But why didn't it work when targeting the span?
Because the span is inside the link. I shouldn't be the answer to the exercise but it should have worked in the editor right?


#4

Because span is just an inline-element which target the word inside the link? it doesn't target the actual link


#5

how do you target the link???


#6

by using the correct css selector.

I will give you one more hint, here is a paragraph html element:

<p>i am a paragraph</p>

now, if i want to target the paragraph in css:

p {
  property: value;
}

now, here is a html link element:

<a></a>

now, you think what the correct css selector is. If you need any further help, post your code