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.