- Home
- /
- Tutorials
- /
- HTML Tutorial
- /
- HTML <abbr> Tag
HTML Tags
HTML <abbr> Tag
The abbr tag marks an abbreviation like HTML, GST or NASA, and puts the full form in its title attribute. Mouse users see the full form as a tooltip on hover. Everyone else depends on you spelling it out in the text too.
That last point is the part most tutorials skip. Tooltips do not appear on phones, keyboard users cannot trigger them, and most screen readers do not read the title by default. So the best habit is to write the full form the first time, and use <abbr> to connect the two.
Syntax
html
<abbr title="Full Form">Abbreviation</abbr>| Attribute | What it does |
|---|---|
| title | The full form of the abbreviation, shown as a tooltip on hover. |
Global attributes such as class and id also work.
Example
html
<!DOCTYPE html>
<html>
<head>
<title>Abbr Tag Example</title>
<style>
abbr {
cursor: help;
}
</style>
</head>
<body>
<h1>HTML <abbr> Tag Example</h1>
<p>
The term <abbr title="HyperText Markup Language">HTML</abbr> is used to create the structure of web pages.
</p>
<p>
<abbr title="Cascading Style Sheets" id="css" class="highlight" style="color: #2c3e50;">CSS</abbr> controls the design and layout of web pages.
</p>
</body>
</html>Hover over "HTML" or "CSS" and the full name appears as a tooltip. The CSS in the example adds a question-mark cursor, a common hint that there is more information.
The pattern that works for everyone
Spell it out once, then abbreviate
html
<p>
Cascading Style Sheets (<abbr title="Cascading Style Sheets">CSS</abbr>)
control how a page looks. With CSS you can...
</p>Readers on any device get the full form once, and the short form after that.
Browser Support
Chrome | Edge | Firefox | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| Yes | Yes | Yes | Yes | Yes | Yes |
Good to know
- Browsers may show a dotted underline under
<abbr>with a title. Change or remove it with CSStext-decoration. <abbr>replaced the old<acronym>tag, which is obsolete. See the acronym tag.- When you define a term for the first time, combine it with the dfn tag.
HTML <abbr> Tag exercises
Expand an abbreviation
Write this paragraph. Mark HTML as an abbreviation that expands to HyperText Markup Language: HTML structures a page.
Result
