<dfn>

A term being defined at this point in the text, that is, the first, explanatory use of the concept.

Display
inline
Closing tag
Required
Permitted content
Phrasing content without other <dfn> elements
On this page

Example

#
HTML
<p>A <dfn>variable</dfn> is a named spot in memory where a program stores a value, for example a player's score.</p>
Preview

Definition and usage

#

The <dfn> element marks a term you’re defining right there. The definition has to be in the immediate surroundings: in the same paragraph, in the same <dt> and <dd> pair of a definition list, or in the section that contains the term. Browsers display <dfn> in italics.

Mark only the place where the concept is explained with it, not every occurrence of it. If the element’s content is an abbreviation or another form of the term, give the full wording in the global title attribute.

It’s worth giving the definition an id. You can then link to the term further in the text, and the reader can jump back to the explanation with one click. That’s how convenient glossaries are built.

Syntax

#
Syntax
<p><dfn>Term</dfn> is…</p>

Attributes

#

This element has no attributes of its own. It supports the global attributes, such as class, id and hidden.

More examples

#
A defined abbreviation with a link
HTML
<p>
  The <dfn id="def-dom"><abbr title="Document Object Model">DOM</abbr></dfn>
  is the tree of objects the browser builds from a page's HTML code.
</p>
<p>Scripts change how a page looks by modifying the <a href="#def-dom">DOM</a>.</p>
Preview

Default CSS

#

Most browsers display this element with these default styles:

CSS
dfn {
  font-style: italic;
}

Browser support

#

Widely available

Works in all modern browsers, phones included. You can use it without worry.

  • Chrome
  • Edge
  • Firefox
  • Safari

Good practices

#
  • Mark only the defining occurrence of the concept, usually the first one.
  • Give the definition an id and link to it from later in the text.
  • In glossaries, put <dfn> inside <dt>, and the explanation in <dd>.

Related entries

#

Spotted a mistake or missing an example? Write to us.