My <link> tag is not working on lesson 12


#1

Hey there,

I am attempting to complete HTML/CSS lesson "12. Check Yourself Before you Wreck Yourself". My hangup seems to be on the portion. I keep getting an error "Did you remember to close your <link> tag?" As far as I understand, link is a self-closing tag, and I put the bracket on. The code is working, it's not seeing the closed tag.

Here's my code:

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css">
		<title>Result</title>
	</head>
	<body>
		<h1>Change me to Verdana.</h1>
		<h3>Change me to Courier.</h3>
		<p>Make me purple!</p>
	</body>
</html>

Am I crazy? Or is that not correct?


#2

Hi,

Yes you are correct it is a self closing tag,

<!-- try like this -->
<link type="text/css" rel="stylesheet" href="stylesheet.css" />

Also try a refreshing your page


#3

Hey, that did it! I added the "/" to the end.

For self-closing tags, can they only be closed using the slash "/" symbol at the end? <link type="text/css" rel="stylesheet" href="stylesheet.css" /> Can I also just leave the slash out, as I did in my attempt?


#4

The slash is not needed, Codecademy's SCT was looking for it thus didn't let you pass.

No to close 'self closing tags' you have to put > slash can be added but not required

The XHTML format requires the />
                        space slash arrow^


#5

Thank you for your help, and for taking the time to answer my questions. It means quite a bit.:thumbsup::vulcan: