2 ms·
> Void elements lacking the need for a closing tag or closing slash is one of the weird edge cases in HTML. While it's not in the HTML spec It's explicitly in
by Izkata 3y ago
> Void elements lacking the need for a closing tag or closing slash is one of the weird edge cases in HTML. While it's not in the HTML spec
It's explicitly in the HTML5 spec as allowed, but not required.
- assimpleaspossi 3y agoThey are allowed due to the big push for XHTML in the past and making them invalid might cause problems for a ton of sites built that way. However, the slash carries no meaning. It does nothing. And browsers are instructed to ignore it. If anything, it can only cause problems: https://github.com/validator/validator/wiki/Markup-%C2%BB-Void-elements#trailing-slashes-directly-preceded-by-unquoted-attribute-values https://github.com/validator/validator/wiki/Markup-%C2%BB-Vo...