References

Beginner-friendly references for web development, with live, editable examples.

The HTML <dfn> tag

Element All modern browsers Updated
Quick answer

The HTML <dfn> element marks the defining instance of a term — the place where the term is introduced and explained. The nearest containing paragraph or section should provide the definition; the term itself goes in the <dfn>.

Overview

The <dfn> element identifies the defining instance of a term — the one sentence where the term is being defined, not every place it appears. The surrounding text supplies the actual definition.

By convention, the nearest enclosing paragraph, definition list, or section should contain the definition of the term marked by <dfn>. You can give the term an explicit name with the title attribute, or wrap an <abbr> inside it when the term is an abbreviation.

Browsers render it in italics by default. Use it once per term — at the point of definition — so assistive technology and readers can recognize where each concept is introduced.

Syntax

<p>A <dfn>closure</dfn> is a function bundled with its surrounding state.</p>

Example

Live example
<p>The <dfn title="HyperText Markup Language">HTML</dfn> language structures web content.</p>

Best practices

  • Use <dfn> only at the point where a term is defined, not on every use.
  • Make sure the surrounding text actually defines the term.
  • Wrap an <abbr> inside it when defining an abbreviated term.
  • Use the title attribute to give the term an explicit canonical name if needed.

Frequently asked questions

What is the dfn element for?
To mark the defining instance of a term — the place where the term is introduced and defined.
Should I use dfn every time a term appears?
No. Use it only once, at the sentence where the term is defined.
Where does the definition itself go?
In the surrounding text — the nearest paragraph, section or definition list should contain the term's definition.
Does dfn italicize the term?
Yes, by default. The styling is incidental; its meaning is marking the defining instance.