哪些HTML元素不能包含子节点? [英] Which HTML elements can't contain child nodes?

查看:121
本文介绍了哪些HTML元素不能包含子节点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一个详尽的列表,但找不到任何地方。为了避免不了解规格,有没有人知道他们是什么(我认为可以包含孩子的元素的补充列表也是有用的)。



这个列表在XHTML 1和HTML5之间有多少不同?

解决方案

你可以找到一个void元素的列表(不能有 HTML5规格中的任何儿童中心)。



除了HTML5中引入的新元素之外,XHTML中的void元素列表是一样的。


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?

解决方案

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.

这篇关于哪些HTML元素不能包含子节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆