我可以在DL / DT / DD内放置什么东西吗? [英] Can I put anything inside DL/DT/DDs?
问题描述
我的意思是在DT或DD中插入任何我想要的任何东西?
$ b $我可以使用定义列表,就像无序/有序列表一样吗? b < dl>
< dt>
...
< / dt>
< dd>
...
< / dd>
< / dl>
做任何浏览器或搜索引擎抱怨?
根据评论更新答案: 原本在2011年为HTML 4 ,但HTML5的答案不同: 原始答案:
dt
流内容,但没有页眉,页脚,分段内容或标题内容后代。
dd
流量内容。
DT
元素应该包含内联内容。
DD
元素应包含
developer.mozilla.org/zh/HTML/Block-level_elementsrel =nofollow noreferrer>块级内容。定义列表仅与该列表中的其他类型的列表略有不同
的项目由两部分组成:一个术语和
a描述。该术语由DT元素
给出,并且限于
内联内容。描述是
,其中包含
块级内容的DD元素。
来源: W3C
can I use definition lists just like unordered/ordered lists?
I mean insert DIVs any anything I want inside DT or DD?
<dl>
<dt>
...
</dt>
<dd>
...
</dd>
</dl>
Do any browsers, or search engines complain?
Updated answer based on comments:
This was originally answered in 2011 for HTML 4, but the answer is different for HTML5:
dt
Flow content, but with no header, footer, sectioning content, or heading content descendants.dd
Flow content.
- dt element reference on W3C
- dd element reference on W3C
Original answer:
DT
elements should contain inline content.
DD
elements should contain block-level content.
Definition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description. The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content.
Source: W3C
This question is also an interesting read: Why use definition lists (DL,DD,DT) tags for HTML forms instead of tables?
这篇关于我可以在DL / DT / DD内放置什么东西吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!