<dfn>

  • Revision slug: HTML/Element/dfn
  • Revision title: dfn
  • Revision id: 81478
  • Created:
  • Creator: hobophobe
  • Is current revision? No
  • Comment Use syntax highlighting; 8 words added, 4 words removed

Revision Content

The Definition (<dfn>) HTML element represents the defining instance of a term.

{{ HTMLVersionInline("5") }} Usage Notes:
  • The <dfn> element marks the term being defined; the definition of the term should be given by the surrounding {{ HTMLElement("p") }}, {{ HTMLElement("section") }} or definition list group (usually a {{ HTMLElement("dt") }}, {{ HTMLElement("dd") }} pair).
  • The exact value of the term being defined is determined by the following rules:
    • If the <dfn> element has a title attribute, then the term is the value of that attribute.
    • Else, if it contains only an {{ HTMLElement("abbr") }} element with a {{ htmlattrxref("title", "abbr") }} attribute, then the term is the value of that attribute.
    • Otherwise, the text content of the <dfn> element is the term being defined.

Attributes

Like all HTML elements, this element provides the global attributes. It defines no other attributes. In {{ HTMLVersionInline("5") }}, the title attribute has special meaning, as noted above.

Examples

The following examples are valid in {{ HTMLVersionInline("5") }}.

<!-- 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>

Later in the same document:

<dl>
  <!-- Define "World-Wide Web" and reference definition for "the Internet" -->
  <dt>
    <dfn id=def-www>
      <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>

DOM interface

This element implements the HTMLElement interface.

See also

  • Elements related to definition lists: {{ HTMLElement("dl") }}, {{ HTMLElement("dt") }}, {{ HTMLElement("dd") }}
  • {{ HTMLElement("abbr") }}

Revision Source

<p>The Definition (<code>&lt;dfn&gt;</code>) HTML element represents the defining instance of a term.</p>
<div class="note"><strong>{{ HTMLVersionInline("5") }} Usage Notes:</strong>
<ul> <li>The <code>&lt;dfn&gt;</code> element marks the term being defined; the definition of the term should be given by the surrounding {{ HTMLElement("p") }}, {{ HTMLElement("section") }} or definition list group (usually a {{ HTMLElement("dt") }}, {{ HTMLElement("dd") }} pair).</li> <li>The exact value of the term being defined is determined by the following rules: <ul> <li>If the <code>&lt;dfn&gt;</code> element has a <strong>title</strong> attribute, then the term is the value of that attribute.</li> <li>Else, if it contains only an {{ HTMLElement("abbr") }} element with a {{ htmlattrxref("title", "abbr") }} attribute, then the term is the value of that attribute.</li> <li>Otherwise, the text content of the <code>&lt;dfn&gt;</code> element is the term being defined.</li> </ul> </li>
</ul>
</div>
<h2>Attributes</h2>
<p>Like all HTML elements, this element provides the <a href="../../../../en/HTML/Global_attributes" rel="internal">global attributes</a>. It defines no other attributes. In {{ HTMLVersionInline("5") }}, the <strong>title</strong> attribute has special meaning, as noted above.</p>
<h2>Examples</h2>
<p>The following examples are valid in {{ HTMLVersionInline("5") }}.</p>
<pre class="brush: html">&lt;!-- Define "The Internet" --&gt;
&lt;p&gt;&lt;dfn id=def-internet&gt;The Internet&lt;/dfn&gt; is a global system of interconnected networks that use the Internet Protocol Suite (TCP/IP) to serve billions of users worldwide.&lt;/p&gt;
</pre>
<p>Later in the same document:</p>
<pre class="brush: html">&lt;dl&gt;
  &lt;!-- Define "World-Wide Web" and reference definition for "the Internet" --&gt;
  &lt;dt&gt;
    &lt;dfn id=def-www&gt;
      &lt;abbr title="World-Wide Web"&gt;WWW&lt;/abbr&gt;
    &lt;/dfn&gt;
  &lt;/dt&gt;
  &lt;dd&gt;The World-Wide Web (WWW) is a system of interlinked hypertext documents accessed on &lt;a href="#def-internet"&gt;the Internet&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;
</pre><h2>DOM interface</h2>
<p>This element implements the <code><a href="../../../../en/DOM/element" rel="internal">HTMLElement</a></code> interface.</p>
<h2>See also</h2>
<ul> <li>Elements related to definition lists: {{ HTMLElement("dl") }}, {{ HTMLElement("dt") }}, {{ HTMLElement("dd") }}</li> <li>{{ HTMLElement("abbr") }}</li>
</ul>
Revert to this revision