<dfn>

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.

摘要

HTML 定义元素 (<dfn>) 表示术语的一个定义。

备注: <dfn> 元素标记了被定义的术语;术语定义应当在 <p>, <section>或定义列表 (通常是<dt>, <dd> 对) 中给出。

  • 被定义术语的值由下列规则确定:

    1. 如果 <dfn> 元素有一个 title 属性,那么该术语的值就是该属性的值。
    2. 否则,如果它仅包含一个 <abbr> 元素,该元素拥有 title 属性,那么该术语的值就是该属性的值。
    3. 否则,<dfn> 元素的文本内容就是该术语的值。
内容分类 Flow content, phrasing content, palpable content.
允许的内容 Phrasing content, but no <dfn> element must be a descendant.
标签省略 不允许,开始标签和结束标签都不能省略。
允许的父元素 Any element that accepts phrasing content.
DOM 接口 HTMLElement

属性

该元素包括 全局属性

在 HTML5 中,title 属性拥有特殊含义,见上文。

示例

下列示例是合法的 HTML5。

html
<!-- Define "The Internet" -->
<p>
  <dfn id="def-internet">The Internet</dfn> is a global system of interconnected
  networks that use the Internet Protocol Suite (TCP/IP) to serve billions of
  users worldwide.
</p>

在同一文档的后面:

html
<dl>
  <!-- Define "World-Wide Web" and reference definition for "the Internet" -->
  <dt>
    <dfn>
      <abbr title="World-Wide Web">WWW</abbr>
    </dfn>
  </dt>
  <dd>
    The World-Wide Web (WWW) is a system of interlinked hypertext documents
    accessed on <a href="#def-internet">the Internet</a>.
  </dd>
</dl>

结果

规范

Specification
HTML
# the-dfn-element

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
dfn

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

相关链接