Basic Syntax
The simplest use: wrap an abbreviation and set title to its full form. The browser shows the short text and reveals the expansion on hover.
<abbr title="World Wide Web">WWW</abbr>
By the end of this tutorial, you’ll confidently mark up abbreviations and acronyms in real-world HTML projects.
Write valid <abbr> elements with the short form visible and the expansion in title.
Provide the full expanded form for tooltips and assistive technologies.
Mark up technical terms, acronyms, and unfamiliar shortenings in running text.
Customize the dotted underline and hover states while keeping tooltip cues visible.
Understand why HTML5 replaced <acronym> with a single <abbr> element.
Apply accessibility and semantic HTML best practices used on professional sites.
<abbr> Tag?The abbreviation element (<abbr>) is an inline HTML tag used to mark up shortened forms of words and phrases. Browsers typically render it with a dotted underline to signal that extra information is available on hover or focus.
Using <abbr> tells search engines, parsers, and assistive technologies that the wrapped text is a shortened form—not arbitrary styling. Pair it with a meaningful title attribute for the full expansion.
The element is inline, so it flows naturally inside paragraphs, headings, and lists. The visible text is the abbreviation itself (e.g. HTML, CSS, PNG), while the optional but strongly recommended title attribute holds the long form.
Wrap the abbreviation inside <abbr> and set title to the full expanded form:
<!-- Basic abbr syntax -->
<abbr title="World Wide Web">WWW</abbr>HTML, not the full expansion).title holds the full expanded form and powers the native browser tooltip.<abbr> is an inline element—it can appear inside paragraphs, lists, and headings.<abbr />) is not valid in HTML.The <abbr title="HyperText Markup Language">HTML</abbr> document structure is fundamental to web development.| Use Case | Code Snippet | Result |
|---|---|---|
| Basic abbreviation | <abbr title="World Wide Web">WWW</abbr> | WWW |
| Technical acronym | <abbr title="HyperText Markup Language">HTML</abbr> | HTML |
| File format | <abbr title="Portable Network Graphics">PNG</abbr> | PNG |
| API term | <abbr title="Application Programming Interface">API</abbr> | API |
| With lang hint | <abbr lang="fr" title="Organisation...">ONU</abbr> | Hover for French expansion |
| Default browser style | <abbr title="...">CSS</abbr> | Dotted underline + tooltip |
The <abbr> tag has a small API—one meaningful attribute plus standard global attributes:
title Required*The full expanded form of the abbreviation. Browsers show it as a tooltip on hover; screen readers may announce it on focus.
title="Cascading Style Sheets"id / class GlobalStandard global attributes for styling, scripting, and anchor targets.
<abbr class="tech-term" ...>lang OptionalHints the language of the abbreviation or its expansion when it differs from the page language.
lang="fr"aria-* A11ySupplement with ARIA when tooltips alone are insufficient—but prefer clear prose and a good title first.
aria-label="HyperText Markup Language"* title is not strictly required by the HTML spec, but omitting it removes the tooltip and hurts accessibility. Always provide a meaningful expansion in production.
Real-world abbreviation patterns with copy-ready code, live previews, and hands-on practice. Hover over abbreviations in the output to see tooltips.
The simplest use: wrap an abbreviation and set title to its full form. The browser shows the short text and reveals the expansion on hover.
<abbr title="World Wide Web">WWW</abbr>The title attribute is the heart of the <abbr> tag. It stores the full expanded form and displays it as a native browser tooltip on mouse hover.
<abbr title="Cascading Style Sheets">CSS</abbr>Here are the most frequent ways developers use the <abbr> tag in real projects.
The primary use of <abbr> is marking up standard abbreviations and acronyms within running text. This enhances both accessibility and understanding without disrupting the reading flow.
The <abbr title="HyperText Markup Language">HTML</abbr> document structure is fundamental to web development.By incorporating the title attribute, <abbr> offers an informative tooltip, ensuring users can quickly grasp the full meaning of an unfamiliar abbreviation without leaving the page.
<abbr title="Portable Network Graphics">PNG</abbr> is a widely used image format on the web.You can use several <abbr> elements in the same paragraph. Each carries its own title with the correct expansion—ideal for technical articles and documentation.
Learning <abbr title="HyperText Markup Language">HTML</abbr> and
<abbr title="JavaScript">JS</abbr> along with
<abbr title="Cascading Style Sheets">CSS</abbr> is essential for web development.HTML4 introduced a separate <acronym> tag for pronounceable acronyms (e.g. NASA) and kept <abbr> for shortenings like “etc.” In HTML5, <acronym> was removed. Use <abbr> for all abbreviations and acronyms today.
<abbr> HTML5Use for all abbreviations and acronyms: HTML, CSS, NASA, API, etc.
<abbr title="National Aeronautics and Space Administration">NASA</abbr><acronym> DeprecatedRemoved from HTML5. Replace any legacy <acronym> tags with <abbr> in modern documents.
<!-- Do not use in new HTML -->Browsers apply a default dotted underline to <abbr>. Customize it to match your design while keeping a visual cue that a tooltip exists:
default Dotted underline:hover Color change:focus-visible Keyboard focuscursor: help Tooltip hint/* Base abbreviation */
abbr {
cursor: help;
border-bottom: 1px dotted #64748b;
text-decoration: none;
}
/* Hover */
abbr:hover {
color: #2563eb;
border-bottom-color: #2563eb;
}
/* Keyboard focus */
abbr:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 2px;
}Live styled abbreviations — hover to see tooltips
Wrap the abbreviation in <abbr> and set title to the full expansion.
The short form appears inline. Most browsers add a dotted underline to signal that more info is available.
A native tooltip shows the title value. Screen readers may announce the expansion on focus.
Readers understand unfamiliar terms without cluttering the page. Search engines and assistive tech gain semantic context from the markup.
The <abbr> tag is supported in every modern browser and all legacy browsers including Internet Explorer. No polyfills or fallbacks are needed.
From legacy Internet Explorer to the latest Chromium builds — the abbreviation element is a universally supported part of semantic HTML.
The tag works everywhere; tooltip interaction varies slightly by device.
title on touch devices Tooltips may require a long-press; don’t rely on them alone for critical infoBottom line: Ship abbreviation markup with confidence. The core <abbr> element is safe to use in every production environment today.
Mastering the <abbr> tag is essential for writing accessible, semantic HTML. Wrap unfamiliar abbreviations, always provide a meaningful title, and use <abbr> instead of the deprecated <acronym>.
Your readers—and search engines—will thank you for the added clarity. Use the quick reference above and experiment until abbreviation markup becomes second nature.
title attribute with the full expanded form<abbr> for standard abbreviations and acronyms to add semantic meaningcursor: help so users know a tooltip exists<abbr> for technical terms your audience may not know<acronym> tags with <abbr>title attribute—it removes the tooltip and hurts accessibility<abbr> when the full form is already written nearby in the same sentence<acronym> tag in new HTML5 documents<abbr>Bookmark these before you ship — they’ll make every abbreviation you write clearer and more accessible.
<abbr> marks abbreviations and acronyms inline — not just styled text.
The title attribute stores the full expanded form shown as a native tooltip.
Sighted users see the expansion on hover; keep a dotted underline as a visual hint.
UXHTML5 removed <acronym>. Use <abbr> for all shortenings today.
Screen readers may announce the title value — always provide an accurate expansion.
Supported in every browser including IE. No polyfills or fallbacks required.
Compatibility<abbr> element marks up abbreviations and acronyms. Use the title attribute for the full form, shown as a tooltip on hover and available to screen readers.title, users lose the tooltip and assistive technologies may only read the short letters.<acronym> was removed in HTML5. Use <abbr> for all abbreviations and acronyms, whether pronounceable (NASA) or not (etc.).<abbr>. Use it for technical terms like HTML, API, or PNG.title value when the element is focused. Provide a clear, accurate expansion for the best experience.abbr in your stylesheet to change the underline, color, or cursor. Keep a visual hint that a tooltip is available.Open the HTML editor, add abbreviation markup, and see tooltips in the preview instantly.
8 people found this page helpful