Hi everyone, does anyone have a problem on step 4 “Building registration form” course?
I am sure that my answer already correct, even I change my ie (from chrome to safari), in case something wrong with my browser.
“Your link element should be a self-closing element.”
Sometimes you will see self-closing tags end with />, which is what the test is expecting in this case. So just add the forward slash at the end and it will pass.
I’m not sure HTML5 requires the forward slash at the end of self closing tags such as <link>. Might be something worth looking into as if it does not then this test may be too strict.
“Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.”
This seems to me to be saying that the forward slash on self-closing void elements is optional.
This is what happens when you let React developers teach HTML
But in all seriousness, the trailing slash is not only optional but is in fact completely ignored. You won’t (pretty sure) see examples in the specs (or MDN) with a trailing slash either. The slash is apparently required in XHTML 1.0 (which conforms with XML syntax rules).
It should in my opinion definitely not be required by the test. I will open an issue for it.