3 ms·
I'm not sure that you can have self-closing custom tags in HTML5. Per [1], ...if the element is one of the void elements, or if the element is a foreign e
by jffry 10y ago
I'm not sure that you can have self-closing custom tags in HTML5. Per [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 (/). This character has no effect
on void elements, but on foreign elements
it marks the start tag as self-closing.
The list of element types [2] is fairly short, so I think if you attempted to self-close a custom tag, behavior might depend on how the parser's error recovery treats custom elements.
[1] http://w3c.github.io/html/syntax.html#start-tags http://w3c.github.io/html/syntax.html#start-tags
[2] http://w3c.github.io/html/syntax.html#writing-html-documents-elements http://w3c.github.io/html/syntax.html#writing-html-documents...
- bambax 10y agoYou're right it seems! I have edited my comment to reflect this. (Why would HTML5 have both self-closing and non-self closing tags though?? It's just a syntax shortcut, they should either take it or leave it, but create a special class of "empty tags" seems crazy to me).