< li>内部的标签是什么? [英] What are the allowed tags inside a <li>?

查看:106
本文介绍了< 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.

这篇关于&lt; li&gt;内部的标签是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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