What are all the valid self-closing elements in XH

2018-12-31 07:02发布

What are all the valid self-closing elements (e.g. <br/>) in XHTML (as implemented by the major browsers)?

I know that XHTML technically allows any element to be self-closed, but I'm looking for a list of those elements supported by all major browsers. See http://dusan.fora.si/blog/self-closing-tags for examples of some problems caused by self-closing elements such as <div />.

13条回答
余生请多指教
2楼-- · 2018-12-31 07:32

Another self closing tag problem for IE is the title element. When IE (just tried it in IE7) sees this, it presents the user a blank page. However you "view source" and everything is there.

<title/>

I originally saw this when my XSLT generated the self closing tag.

查看更多
登录 后发表回答