🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

<abbr>

AI & DATA SCIENCE // abbr-tag

The <abbr> element marks an abbreviation or acronym, with the title attribute providing its full expansion as a tooltip.

Syntax

<abbr title="Cascading Style Sheets">CSS</abbr>

Deep Dive Course

**`<abbr>`** wraps a shortened form of a word or phrase, with the **`title`** attribute holding the full, expanded text. Browsers typically render it with a dotted underline and show the `title` as a tooltip on hover. Screen readers can announce the expansion too, which helps users unfamiliar with the abbreviation. It's good practice to spell out the term in full the first time it appears on a page, with the abbreviation in parentheses, and use `<abbr>` for subsequent mentions.

1Understanding <abbr>

`<abbr>` wraps a shortened form of a word or phrase, with the `title` attribute holding the full, expanded text. Browsers typically render it with a dotted underline and show the title as a tooltip on hover. Screen readers can announce the expansion too, which helps users unfamiliar with the abbreviation. It's good practice to spell out the term in full the first time it appears on a page, with the abbreviation in parentheses, and use <abbr> for subsequent mentions.

💡

Since the title tooltip only appears on mouse hover, it's not reliably accessible on touch devices — spelling out the term at least once in the visible page content is the most robust approach.

editor.html
<p><abbr title="HyperText Markup Language">HTML</abbr> is the standard markup language for web pages.</p>
localhost:3000

2Practical Example

Here is a real-world application of <abbr> showing how it is used in production HTML.

editor.html
<!-- Spelling out on first use, then abbreviating -->
<p>The World Health Organization (<abbr title="World Health Organization">WHO</abbr>) issued new guidance. Later, the <abbr title="World Health Organization">WHO</abbr> clarified the policy.</p>
localhost:3000

3Best Practices

Follow these guidelines when working with <abbr>:

1. Always include the title attribute with the full expansion

2. Spell out the term in full on first use, then use <abbr> for later mentions

3. Don't rely solely on the hover tooltip for touch/mobile accessibility — provide visible context too

⚠️

Tip: Since the title tooltip only appears on mouse hover, it's not reliably accessible on touch devices — spelling out the term at least once in the visible page content is the most robust approach.

editor.html
<p><abbr title="HyperText Markup Language">HTML</abbr> is the standard markup language for web pages.</p>
localhost:3000

Examples

Example 01Basic Usage
<p><abbr title="HyperText Markup Language">HTML</abbr> is the standard markup language for web pages.</p>
Example 02Advanced Example
<!-- Spelling out on first use, then abbreviating -->
<p>The World Health Organization (<abbr title="World Health Organization">WHO</abbr>) issued new guidance. Later, the <abbr title="World Health Organization">WHO</abbr> clarified the policy.</p>

Best Practices

  • Always include the title attribute with the full expansion
  • Spell out the term in full on first use, then use for later mentions
  • Don't rely solely on the hover tooltip for touch/mobile accessibility — provide visible context too

Interview Question

Why might relying only on <abbr>'s title tooltip be an accessibility concern?

Hint: Think about devices without a mouse cursor, like phones and tablets.

The title attribute's tooltip only appears on mouse hover, which doesn't exist on touch-only devices (phones, tablets) and can be awkward for keyboard-only users to trigger. Screen readers generally do announce the title, which helps, but sighted touch-device users have no way to see the expansion at all. That's why spelling out the term in full at least once in the visible text remains the most universally accessible approach.

Exercises

EasyPractice using <abbr> in a real scenario.
View Solution
<p><abbr title="HyperText Markup Language">HTML</abbr> is the standard markup language for web pages.</p>

Frequently Asked Questions

Why might relying only on <abbr>'s title tooltip be an accessibility concern?

The title attribute's tooltip only appears on mouse hover, which doesn't exist on touch-only devices (phones, tablets) and can be awkward for keyboard-only users to trigger. Screen readers generally do announce the title, which helps, but sighted touch-device users have no way to see the expansion at all. That's why spelling out the term in full at least once in the visible text remains the most universally accessible approach.

Related Functions

acronym-tag