I cannot go any further because of this bug. In the “Learn HTML Forms by Building a Registration Form” in the recently launched (New) Responsive Web Design, the task tells me to add a self closing link. It continues " Give it a rel
attribute value of stylesheet
, a type
attribute value of text/css
, and an href
attribute value of styles.css
."
I have done EXACTLY that. It double, triple checked. It is 100% correct. However, when I submit the code, I receive a check my code and " Your link
element should be a self-closing element."
Everything on that page is 100% correct. Including the text for the title, etc.
Please help!
There must be some bug on the code.
Thank you,
Luis
xynoan
June 23, 2022, 9:32am
2
Can you share your full code?
ILM
June 23, 2022, 10:56am
3
you need to write the self closing element as <link />
It’s a small bug that is being ridicolously difficult to fix
opened 08:56PM - 22 Feb 22 UTC
closed 07:08AM - 29 Jun 22 UTC
type: bug
help wanted
scope: curriculum
<!--
NOTE: If you're reporting a security issue, don't create a GitHub issue. I… nstead, email security@freecodecamp.org. We will look into it immediately.
-->
## Affected page
https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/step-4
There are most likely other steps affected as well.
## Discussion
The test for this step fails if the `<link>` tag does not include the forward slash before the ending `>`. According to [whatwg.org 13.1.2.1 Start tags](https://html.spec.whatwg.org/multipage/syntax.html#start-tags), point 6:
"Then, if the element is one of the [void elements](https://html.spec.whatwg.org/multipage/syntax.html#void-elements), or if the element is a [foreign element](https://html.spec.whatwg.org/multipage/syntax.html#foreign-elements), then there **may** be a single U+002F SOLIDUS character (/). **This character has no effect on [void elements](https://html.spec.whatwg.org/multipage/syntax.html#void-elements)**, but on foreign elements it marks the start tag as self-closing."
This seems to imply that the forward slash is optional on the `<link>` tag and thus the test should pass if the user does not include it. There are 14 void elements that this applies to:
[area](https://html.spec.whatwg.org/multipage/image-maps.html#the-area-element), [base](https://html.spec.whatwg.org/multipage/semantics.html#the-base-element), [br](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-br-element), [col](https://html.spec.whatwg.org/multipage/tables.html#the-col-element), [embed](https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-embed-element), [hr](https://html.spec.whatwg.org/multipage/grouping-content.html#the-hr-element), [img](https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element), [input](https://html.spec.whatwg.org/multipage/input.html#the-input-element), [link](https://html.spec.whatwg.org/multipage/semantics.html#the-link-element), [meta](https://html.spec.whatwg.org/multipage/semantics.html#the-meta-element), [param](https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-param-element), [source](https://html.spec.whatwg.org/multipage/embedded-content.html#the-source-element), [track](https://html.spec.whatwg.org/multipage/media.html#the-track-element), [wbr](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-wbr-element)
system
Closed
December 22, 2022, 10:57pm
4
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.