Can't get past Step 4

My problem is in (New) Responsive Web Design, course Learn HTML Forms by Building a Registration Form, Step 4. Whenever I try to check my code I get a your code does not pass message and a hint saying Your link element should be a self-closing element.

My code looks like this:


<!DOCTYPE html>
<html>
<head>
  <title>Registration Form</title>
  <link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
</body>
</html>

It is a self closing link element what I’ve written, isn’t it? Why can’t I get past this step?

Link to the challenge:

Hihi!

I actually remember running into this one myself haha

it actually wants it formatted like :
<link rel="stylesheet" type="text/css" href="styles.css" />

2 Likes

Thank you! That gave me a headache :sweat_smile:

1 Like

No problem! it’s weird because sometimes it’ll say self closing and not need it, but at this point, anytime there’s a self-closing tag I just add it to make sure haha

This is the HTML spec of a self closing tag:

A Self-closing tag is a special form of start tag with a slash immediately before the closing right angle bracket. These indicate that the element is to be closed immediately, and has no content. Where this syntax is permitted and used, the end tag must be omitted.

Note: with a slash immediately before the closing right angle bracket

Meaning that

<br> // this is an opening tag
<br/> // this is self closing
1 Like

see that makes sense!

i know sometimes i’ll do <br> because that’s how I remember doing it with earlier HTML, but its good to know that’s just standard with self-closing tags thank you!

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