4 ms·
isn't <br /> part of XHTML and not HTML5?
by baby 13y ago
isn't <br /> part of XHTML and not HTML5?
- mjhea0 13y agotechnically, yes - but it can still be used. either is fine.
- grahamel 13y agoActually looking into it seems that it is, and that example is wrong. The spec examples only use <br> and call it a void element (one which can't have any content) but states only foreign elements can be self closing.
- shawnz 13y agoIt's true that void elements can't be self-closing in HTML, but the slash is still allowed. If you scroll down to 8.1.2.1 #6, you will see that the slash is just ignored if present on void elements.