How forgiving are browsers with empty elements written with closing tag?

I've seen code that uses stuff like <input ...></input> just because there is a bug in Perl HTML::Zoom .

How harmful is this syntax when combined with XHTML or HTML5 and common browsers such as Internet Explorer, Chrome and Firefox?

Have they always been forgiving and accepting this syntax? How bad is it anyways?

The W3C Markup Validation Service apparently accepts this as valid XHTML 1.0 Strict, whereas MDN states that in HTML, "using a closing tag on an empty element is usually invalid. For example, <input type="text"></input> is invalid HTML".

On the other hand, validator.nu rejects such markup when using HTML5:

Error: Stray end tag input.
From line 8, column 20; to line 8, column 27
pe="text"></input>↩</div
链接地址: http://www.djcxy.com/p/76878.html

上一篇: XSLT不输出单个<br>标记

下一篇: 如何使用结束标签写入空元素的浏览器?