< li>内部的标签是什么? [英] What are the allowed tags inside a <li>?
问题描述
我一直在寻找< li>
内可用的标签列表,但找不到任何参考。
是否有可能在其中允许任何符合标准的HTML 4+块元素?
TL; DR :< li>
可以包含任何在< body>
。
在列表中的HTML 4.01规范,您将找到DTD的相关摘录:
<!ELEMENT LI - O(%flow;)* - 列表项目 - >
这指定< li>
可能包含流内容,这是所有 block 和 inline 元素。 < li>的HTML5规范
是一样的,它也允许任何流程内容。
I have been searching for the list of tags that are available inside a <li>
but couldn't find any reference.
Is it possible that any standards-compliant HTML 4+ block element is allowed in them?
TL;DR: an <li>
can contain any element that is valid in <body>
.
In the HTML 4.01 spec for lists you’ll find the relevant extract of the DTD:
<!ELEMENT LI - O (%flow;)* -- list item -->
This specifies that an <li>
may contain flow content, which is the collection of all block and inline elements.
The HTML5 spec for an <li>
is the same in that it also allows any flow content.
这篇关于< li>内部的标签是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!