3 ms·
It is valid XML. It means totally different thing in HTML.
by rimliu 7y ago
It is valid XML. It means totally different thing in HTML.
- detaro 7y agoThe self-closing form is fine in HTML5 for those examples, since they are void elements. The "/" gets ignored, which is what you want in that case. It fails if you try this with non-void elements: E.g. XHTML <div /> might turn into <div> in HTML5, which opens a div element, which is not the same. (I'm not sure if this behaviour is specified or not) https://html.spec.whatwg.org/multipage/syntax.html#start-tags https://html.spec.whatwg.org/multipage/syntax.html#start-tag... > 6. Then, if the element is one of the void 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 https://html.spec.whatwg.org/multipage/syntax.html#void-elem... > area, base, br, col, embed, hr, img, input, link, meta, param, source, track, wbr