Warning:
This wiki has been archived and is now read-only.

Elements/dfn

From HTML Wiki
Jump to: navigation, search

<dfn>

The <dfn> element represents the defining instance of a term.

Point

  • 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. [Example A]
  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) [Example B]
  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.


HTML Attributes

See global attributes.


Examples

Example A

[try it]

<p>The <dfn title="Hyper Text Markup Language">HTML</dfn> is the publishing language of the World Wide Web.</p>

Example B

Contains an abbr element [try it]:

<p>The <dfn><abbr title="HyperText Markup Language">HTML</abbr></dfn> is the publishing language of the World Wide Web.</p>

Example C

With the addition of an a element, the reference can be made explicit [try it]:

<p>The <dfn id="HTML"><abbr title="HyperText Markup Language">HTML</abbr></dfn>
 is the publishing language of the World Wide Web.</p>
<p>The first version of <a href="#HTML"><abbr title="Hyper Text Markup Language">HTML</abbr></a>
 was described by Tim Berners-Lee in late 1991.</p>


HTML Reference

The HTML5 specification defines the <dfn> element in 4.6.8 The dfn element.