HTML Reference ยท Inline Text
The <dfn> element
Reference for the HTML <dfn> element: marking the defining instance of a term, how the term is chosen, linking to definitions and technical details.
The <dfn> element marks the defining instance of a term: the one place where the term is explained. The sentence, paragraph, <dt>/<dd> pair or section that contains the <dfn> must contain the definition. Browsers display it in italics.
Mark only the term itself, not the whole definition.
<p>A <dfn>haiku</dfn> is a three-line poem with five, seven and five syllables.</p>
Try it
Giving each <dfn> an id lets you link later uses of the term back to its definition.
Attributes
This element has no attributes of its own. It accepts the global attributes. The title attribute has a special meaning here: if present, it must contain exactly the term being defined.
The term is chosen in this order: the title of the <dfn>; otherwise, if the only child is an <abbr> with a title, that title; otherwise, the text content of the <dfn>.
Usage notes
- One definition per term. Use
<dfn>once for each term, where you define it. Later mentions are plain text or links to the definition. - No
<dfn>inside<dfn>. A<dfn>may not contain another<dfn>. - Glossaries. In a
<dl>, wrap the term in the<dt>with<dfn>to say that the<dd>defines it. <dfn>vs<abbr>.<abbr>only expands a short form;<dfn>says "this is where the meaning is explained". They can be combined, as in the example.- Accessibility. The ARIA role
termis exposed, but most screen readers don't announce it. The sentence should make it clear that a definition is given.
Technical summary
| Content categories | Flow content, phrasing content, palpable content |
| Permitted content | Phrasing content, but no <dfn> descendants |
| Tag omission | None; both the start and end tags are required |
| Permitted parents | Any element that accepts phrasing content |
| Implicit ARIA role | term |
| DOM interface | HTMLElement |
| Default display | inline (italic) |
Browser support
Supported in every browser.
Related
<abbr>โ an abbreviation or acronym<dl>,<dt>,<dd>โ description lists for glossaries- Lessons: Quotations, Citations and Abbreviations, Description Lists