<abbr>
abbr Tag
The <abbr>
element is used to indicate an abbreviation or acronym. When using it, ensure that the full term appears in plain text initially, along with the <abbr>
tag to provide context for users.
Syntax
<abbr title="Full Form">Abbreviation</abbr>
abbr
Demo
An abbreviation is presented as follows:
The WHO was founded in 1948.
<h1>The abbr element</h1>
<p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p>
Definition and Usage
The <abbr>
tag is used to define abbreviations or <acronym>
, such as "HTML," "CSS," "Mr.," "Dr.," "ASAP," or "ATM."
title
attribute to display a description of the abbreviation when hovering over the element.Example
The <abbr>
tag can also be used with <dfn>
to define an abbreviation.
CSS is a language that describes the style of an HTML document.
<h1>The abbr element + the dfn element</h1>
<p><dfn><abbr title="Cascading Style Sheets">CSS</abbr></dfn> is a language that describes the style of an HTML document.</p>
<acronym>
Other elements related to text-level semantics:
<a>
<em>
<strong>
<small>
<cite>
<q>
<dfn>
<time>
<code>
<var>
<samp>
<kbd>
<sub>
<sup>
<b>
<i>
<mark>
<ruby>
<rp>
<rt>
<bdo>
<span>
<br>
<wbr>
.
Conclusion
The <abbr>
element is a valuable HTML tag for representing abbreviations and acronyms, improving accessibility by displaying the full form when hovered over. Using the title
attribute helps ensure users understand the abbreviation's meaning. Combining it with elements like <dfn>
further enhances clarity.
<a>
The HTML <a> element defines hyperlinks, enabling navigation to external webpages, resources, or sections within the same document, using attributes like href, target, and rel.
<acronym>
The HTML <acronym> element, once used for defining acronyms with an optional title attribute, is now obsolete and replaced by `<abbr>` for both acronyms and abbreviations.