My code is not passing

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

Could you share a link to the lesson? Nothing’s jumping out at me at the moment, but it’s hard to debug without knowing the task you’re supposed to do.

It help also if you provide a basic description of what problem you are having, to include any error messages. ‘not working’ could mean a million different things.

1 Like

I had the same error. I skipped the step and noticed that at the end of the link tag, there’s a “/”, like this:

Mod Edit: SOLUTION REDACTED

As far as I know, the slash shouldn´t be there, but the code passed.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

I’m sorry, I´m not trying to spoil a solution. I’ve posted it because there´s an error on the self closing tag. At least in all the previous lessons those tag didn’t need a slash at the end to pass the verification.

It happens in this lesson: https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/step-4

If you could refer me to where I’m supposed to report this, I’ll be glad to do so.

Its been reported and is being worked on.

Learn HTML Forms by Building a Registration Form: Step 4 | freeCodeCamp.org

Learn HTML Forms by Building a Registration Form: Step 4 | freeCodeCamp.org

That is the link.

Thanks.

So the self-closing element should include “/” or is something wrong with the test? I ran into the same problem, I have completed a course in basic html/css before attempting your course and this is the first time I ran into this.

To avoid the error remove the type attribute in the link tag because html 5 offers better syntax so the browser understands which type of file u are relating.Even u are not specifies the type. so avoid type in the link tag.

That is not at all correct. Please don’t provide wrong answers.

The / is optional but not needed in general. However, the test still wants it for now.

ok then what is the solution?

The solution is to add a / on the closing >… like was mentioned a couple of time above…

Please don’t just guess and assert that your guess is the fix without checking.

Im not guessing nor fixing , it works for me so i have shared my experience. sorry for the wrong information.

Add a title element to the head , and give your project a title of Registration Form . Also, nest a self-closing link element in the head element. Give it a rel attribute value of stylesheet , a type attribute value of text/css , and an href attribute value of styles.css

If you actually have code that doesn’t have a type attribute but still passes this challenge, then you should make a bug report. That would have to be a super specific bug to your browser because removing the type attribute causes the challenge code tofail for me on multiple other browsers.

Thankyou sir for this valuable information.
And one more question the relation attribute itself gives the information about the file then what is the purpose of type attribute, it also gives the information about the file to the browser then whats the difference between them sir?

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