Which HTML tags have no content

佐手、 提交于 2020-01-23 06:14:41

问题


Some HTML tags like br and hr have no content and cannot have a closing tag. What is the complete set of these tags?


回答1:


Check the table at http://www.w3.org/TR/html4/index/elements.html.




回答2:


Look at the 'EMPTY' column here:

http://www.w3.org/TR/html4/index/elements.html




回答3:


Every tag in the DTD that has EMPTY in the fourth field is empty.




回答4:


http://www.w3schools.com/tags/default.asp

All the one that has a forward slash in their tag name. (correction) thx =O




回答5:


Html don't force the document to be well formatted, so end tags for certain tags like <br> and <hr> can be left out and still the page loads fine, but it's like they cannot have end tags </br> and <br /> works just fine. There is probably no division like Content and Non-Content tags, Refer to this article for details on Tags http://www.devx.com/projectcool/Article/19816



来源:https://stackoverflow.com/questions/3581066/which-html-tags-have-no-content

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!