Need help with html question for beta course

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.

it always told me that the link element should self closing, even after I closed it
thanks for answering guys

Hi @sembodogelar6,

In watching your screenshot, it looks ok, could you provide the link for this step and also share your code to copy it? Thanks in advance.

Thanks for the replay @LucLH , here is link of my course:

Thanks once again

“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.

UPDATE: I don’t think it does.

13.1.2.1 Start tags, point 6:

“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.

P.S. I have opened up an issue for this.

3 Likes

Wow @bbsmooth thanks a lot man!

This is what happens when you let React developers teach HTML :stuck_out_tongue:

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.


Here is what looks like some historical reference for anyone interested
https://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-November/050429.html

2 Likes

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