Which HTML elements can't contain child nodes?

2019-06-15 05:49发布

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条回答
手持菜刀,她持情操
2楼-- · 2019-06-15 06:43

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.

查看更多
登录 后发表回答