14. dfn Element
Introduction
Section titled “Introduction”The <dfn> element represents the defining instance of a term. It’s used to mark the first occurrence of a term that is being defined, typically in a glossary or when introducing new terminology. The dfn element helps identify term definitions and improves semantic meaning.
Basic Usage
Section titled “Basic Usage”<p>The <dfn>HTML</dfn> (HyperText Markup Language) is a markup language.</p>Common Use Cases
Section titled “Common Use Cases”Term Definition
Section titled “Term Definition”<p> <dfn>Semantic HTML</dfn> is HTML that uses elements to convey meaning.</p>With abbr
Section titled “With abbr”Combine with abbreviation:
<p> <dfn><abbr title="HyperText Markup Language">HTML</abbr></dfn> is a markup language.</p>In Definition Lists
Section titled “In Definition Lists”<dl> <dt><dfn>HTML</dfn></dt> <dd>HyperText Markup Language</dd></dl>Best Practices
Section titled “Best Practices”First Occurrence
Section titled “First Occurrence”Use dfn for the first defining instance:
<!-- Good: First occurrence --><p>The <dfn>term</dfn> is defined here.</p><p>Later uses of the term don't need dfn.</p>
<!-- Avoid: Multiple dfn for same term --><p>The <dfn>term</dfn> is defined.</p><p>The <dfn>term</dfn> is used again.</p>