<dfn>
The <dfn> element represents the defining instance of a term. The paragraph, description list group, or section that contains the <dfn> element is considered to provide the definition of the term. This element is particularly useful for glossaries, technical documentation, and educational content.
This page was last updated on 2025-11-17
Syntax
<dfn>term being defined</dfn>
The element requires both opening and closing tags. If the <dfn> element has a title attribute, then the exact value of that attribute is the term being defined. Otherwise, if the element contains exactly one child element and no text, and that child element is an <abbr> element with a title attribute, then the exact value of that attribute is the term being defined. Otherwise, the text content of the <dfn> element is the term being defined.
Attributes
- title - When present, this attribute specifies the term being defined (useful when the displayed text differs from the actual term)
- id - Important for creating links to the definition from other parts of the document
- Global attributes - The <dfn> element supports all global attributes such as
class,style,lang, anddir.
Examples
Basic Definition
<p>A <dfn>validator</dfn> is a program that checks your HTML code for errors against a specification.</p>
Definition with Abbreviation
<p>The <dfn><abbr title="Hypertext Markup Language">HTML</abbr></dfn> is the standard markup language for creating web pages.</p>
Linkable Definition
<p>A <dfn id="def-semantic">semantic element</dfn> clearly describes its meaning to both the browser and the developer.</p>
<!-- Elsewhere in the document -->
<p>When building accessible websites, always use <a href="#def-semantic">semantic elements</a>.</p>
When to Use
Use the <dfn> element when:
- Introducing a new term for the first time with its definition
- Creating glossaries or terminology sections
- Writing technical documentation where precise definitions matter
- Building educational content that introduces new concepts
Best practices:
- Use <dfn> only for the defining instance, not every occurrence of the term
- Add an
idattribute to allow linking back to the definition - Place the definition in the surrounding text, not just the term itself
- Consider combining with <abbr> for abbreviated terms