This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

dfn

Summary

The dfn element indicates the defining instance of a term.

Overview Table

DOM Interface
HTMLElement
  • If the dfn element is specified, nearest parent of the dfn element(paragraph, description list group, or section) must also contain the definitions for the defining term.
  • The priority level of defining term is as follow:
    1. Value of the title attribute in the dfn element.
    2. Value of the title attribute in the abbr element. (if the dfn element contains exactly one element child node and no child text nodes, and that child element is the abbr element
    3. TextContent of the dfn element
  • If the title attribute of the dfn element is present, then it must contain only the term being defined.

Examples

This example uses the dfn element to indicate the defining instance of a new term.

<p>The <dfn title="Garage Door Opener">GDO</dfn>
is a device that allows off-world teams to open the iris.</p>

This example uses the dfn element to indicate the defining instance of a new term that is an abbreviation.

<p>The <dfn><abbr title="Garage Door Opener">GDO</abbr></dfn>
is a device that allows off-world teams to open the iris.</p>
<!-- ... later in the document: -->
<p>Teal'c activated his <abbr>GDO</abbr>
and so Hammond ordered the iris to be opened.</p>

This example uses the dfn element to indicate the defining instance of a new term and then uses an anchor to provide a reference to that instance.

<p>The <dfn id="dfn-gdo"><abbr title="Garage Door Opener">GDO</abbr></dfn>
is a device that allows off-world teams to open the iris.</p>
<!-- ... later in the document: -->
<p>Teal'c activated his <a href="#dfn-gdo"><abbr>GDO</abbr></a>
and so Hammond ordered the iris to be opened.</p>

Usage

 The dfn is a phrasing-level element and can’t contain block-level elements, but it can contain other phrasing type elements like abbr, read on…

If the dfn element has a title attribute, then the value of that attribute serves as the definition for the text inside the element (see Example 1).

If the dfn contains exactly one child element (and no other text) //and// that child element is an abbr element with a title attribute, then the exact value of that title attribute serves as the definition for the text inside the abbr (see Example 2).

If the dfn only contains text, the exact text content of the element gives the term being defined.

If the title attribute of the dfn element is present, then it must contain only the definition of the term being defined.

Notes

If given an id attribute, a dfn may serve as a reference for other elements on the page by anchoring to the dfn (see Example 3).

Related specifications

HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation
HTML 4.01
W3C Recommendation

See also

Related articles

HTML

Text

Other articles

Attributions