How do I give my code an "href" attribute?


#1



I'm currently stuck on the Links and Text Decoration exercise.


The program keeps telling me that I haven't applied an "href" attribute to the CSS, but I feel as though I have since the link I added has changed text decoration and color (though this was done through change to the HTML)


h1 {
    font-family: Verdana, sans-serif;
    color: #576D94;
}
img {
    height: 100px;
    width: 300px;
    border: 1px solid #4682b4;
href {
    text-decoration: none;
    color: #cc0000;
}
p {
    font-size: 18px;
    font-family: Garamond, serif;
    color: #4A4943;
}


#2

i think the href attribute error is an error with your html code, please post your html code. I would use a as css selector, not href


#3

<!DOCTYPE html>
<html>
	<head> 
	    <link type="text/css" rel="stylesheet" href="stylesheet.css">
		<title>Result</title>
	</head>
	<body>
	<h1>
	This is a statement.
	</h1>
	<img src="http://tse2.mm.bing.net/th?id=OIP.Mcb2b7de6adf475a91cd14f20c95b2bb6o0&pid=15.1"/>
	<a style="color:#cc0000; text-decoration:none" href="www.rotoworld.com">Website</a>
	<p>
	This is a comment.
	</p>
	</body>
</html>

#4

apart from the href instead of a as selector, your code is fine, try a different browser


#5

Unfortunately, a different browser didn't work. Any other solutions? Could I be putting something in the wrong place?


#6

your img css selector is missing its closing curly bracket (})


#7

Good eye. Just tried it and it still didn't let me pass the lesson.


#8

could you post an updated version of your html and css code?


#9

h1 {
font-family: Verdana, sans-serif;
color: #576D94;
}
img {
height: 100px;
width: 300px;
border: 1px solid #4682b4;
}
a {
text-decoration: none;
color: #cc0000;
}
p {
font-size: 18px;
font-family: Garamond, serif;
color: #4A4943;
}


#10

    <!DOCTYPE html>
<html>
	<head> 
	    <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
	<h1>
	This is a statement.
	</h1>
	<img src="http://tse2.mm.bing.net/th?id=OIP.Mcb2b7de6adf475a91cd14f20c95b2bb6o0&pid=15.1"/>
	<a href style="color:#cc0000; text-decoration:none" href="www.rotoworld.com">Website</a>
	<p>
	This is a comment.
	</p>
	</body>
</html>

#11

i don't have my day, the style attribute throws off checking script, try with just one href attribute:

<a href="www.rotoworld.com">Website</a>

also, for the thing to actually visit that webpage when included, include http


#12

That seemed to work, but now it's saying I haven't included a link. I don't understand.

I put the link where it was supposed to go in the href attribute, but for some reason it says it's still not right.


#13

Why have you got a style attribute inside the anchor tag? Don't you have it styled in the stylesheet?


#14

Again, post your full html + css code so we can have a look