3 ms·
Wrong.[1] > 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 (/) If you
by imiric 9mo ago
Wrong.[1]
> 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 (/)
If you're going to be pedantic, at least be correct about it.
[1]: https://html.spec.whatwg.org/multipage/syntax.html#start-tags https://html.spec.whatwg.org/multipage/syntax.html#start-tag...
- swiftcoder 9mo agoThere can't however be a separate closing tag, which is a reasonable interpretation of the post you are replying to
- recursive 9mo agoAlso the slash in <br /> explicitly has no effect, per specification.
- eddyg 9mo agoYou left out the rest of the spec: > On void elements, it does not mark the start tag as self-closing but instead is unnecessary and has no effect of any kind. For such void elements, it should be used only with caution — especially since, if directly preceded by an unquoted attribute value, it becomes part of the attribute value rather than being discarded by the parser. (The void elements are listed here: https://developer.mozilla.org/en-US/docs/Glossary/Void_element https://developer.mozilla.org/en-US/docs/Glossary/Void_eleme... )
- imiric 9mo agoAll of that is a far cry from elements not being allowed to be closed. Please point to where the spec mentions that. MDN is not the spec.
- recursive 9mo agoIt's the next sentence. > On void elements, it does not mark the start tag as self-closing but instead is unnecessary and has no effect of any kind. https://html.spec.whatwg.org/multipage/syntax.html#start-tags https://html.spec.whatwg.org/multipage/syntax.html#start-tag...