<dt>:描述性术语元素
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
<dt>
HTML 元素指定描述或定义列表中的术语,因此必须在 <dl>
元素内部使用。它通常后面跟着一个 <dd>
元素;然而,多个连续的 <dt>
元素表示由紧随其后的一个 <dd>
元素定义的多个术语。
随后的 <dd>
(描述详情)元素提供与使用 <dt>
指定的术语相关的定义或其他相关文本。
尝试一下
<p>Please use the following paint colors for the new house:</p>
<dl>
<dt>Denim (semigloss finish)</dt>
<dd>Ceiling</dd>
<dt>Denim (eggshell finish)</dt>
<dt>Evening Sky (eggshell finish)</dt>
<dd>Layered on the walls</dd>
</dl>
p,
dl {
font:
1rem "Fira Sans",
sans-serif;
}
dl > dt {
font-weight: normal;
font-style: oblique;
}
dd {
margin-bottom: 1rem;
}
属性
这个元素只包含全局属性。
示例
有关示例,请参阅为 <dl>
元素提供的示例。
技术概要
内容分类 | 无。 |
---|---|
允许的内容 |
流式内容、但不包括任何 <header> 、<footer> 、分段内容或标题内容的后代元素。
|
标签省略 |
开始标签是必要的。如果该元素后面紧跟着另一个 <dt> 元素或 <dd> 元素,或者父元素中没有更多内容,则可以省略结束标签。
|
允许的父元素 |
一个 <dl> 或(在 WHATWG HTML、W3C HTML 5.2 及以后版本中)作为 <dl> 子元素的 <div> 。该元素可以在 <dd> 或另一个 <dt> 元素之前使用。
|
隐含的 ARIA 角色 | 没有对应的角色 |
允许的 ARIA 角色 |
listitem
|
DOM 接口 |
HTMLElement 直到 Gecko 1.9.2(Firefox 4)版本为止,Firefox 为该元素实现了 HTMLSpanElement 接口。
|
规范
Specification |
---|
HTML # the-dt-element |
浏览器兼容性
BCD tables only load in the browser