Abbreviations and Definitions
You'll learn how to properly mark up abbreviations and define technical terms so browsers and assistive technologies can explain them to users.
Why This Matters
When you write "HTML" or "W3C" on a webpage, sighted users might hover over it or guess from context — but screen reader users have no such clue. HTML gives you two special elements to make abbreviations and definitions accessible to everyone.
The <abbr> Element
Use <abbr> to mark abbreviations and acronyms. The title attribute holds the full expansion:
<p>The <abbr title="World Wide Web Consortium">W3C</abbr> creates web standards.</p>
When someone hovers over "W3C", most browsers show a tooltip with "World Wide Web Consortium". Screen readers can announce both the abbreviation and its meaning.
Think of it like: Adding a footnote that appears on demand, rather than cluttering your text.
The <dfn> Element
Use <dfn> to mark the defining instance of a term — the first place you explain what it means:
<p>A <dfn>web server</dfn> is a computer that stores and delivers web pages to browsers.</p>
This tells browsers and search engines: "this is where we define this term." You only use <dfn> once per term, where you introduce it.
You can combine them:
<p>The <dfn><abbr title="HyperText Markup Language">HTML</abbr></dfn> language structures web content.</p>
When to Use Each
<abbr>: Every time you write an abbreviation that might confuse readers<dfn>: The one spot where you define a new term
Key Takeaway: Use <abbr> with a title attribute to expand abbreviations accessibly, and wrap the defining instance of any term with <dfn> to mark where you explain its meaning.