Which HTML elements can't contain child nodes?

本秂侑毒 提交于 2019-12-08 15:13:36

问题


I've been looking for an exhaustive list, but can't find one anywhere. To avoid having to trawl through the specs, does anyone know what they are (and I suppose a complementary list of elements that can contain children would be useful too).

And how much does this list vary between XHTML 1 and HTML5?


回答1:


You can find a list of void elements (elements that cannot have any child conents) in the HTML5 spec.

With the exception of the new elements introduced in HTML5, the list of void elements in XHTML is the same.



来源:https://stackoverflow.com/questions/4898374/which-html-elements-cant-contain-child-nodes

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