The HTML ‘<abbr>’ tag is used to define an abbreviation or acronym within a web page. When a user hovers over the abbreviation or acronym, a tooltip is displayed that shows the full meaning of the term.
The `<abbr>` tag has two required attributes:
- title
- abbr
The ‘title’ attribute specifies the full term,
While the ‘abbr’ attribute specifies the abbreviated form of the term.
For example
<p>The <abbr title="HyperText Markup Language">HTML</abbr> standard is used to create web pages.</p>
In this example, the word “HTM” is enclosed in an <abbr> tag, and the `title` attribute specifies that “HTML” stands for “HyperText Markup Language”. When a user hover over the “HTML” abbreviation, the full term “HyperText Markup Language” will be displayed in a tooltip.
The <abbr> tag is useful for improving the accessibility and usability of a web page. It allows users who may not be familiar with an abbreviation or acronym to quickly understand its meaning without having to leave the page and search for it elsewhere. Additionally, it can be helpful for users with disabilities who may be using assistive technology to access the content of a web page.
It is important to note that the <abbr> tag should only be used for abbreviations or acronyms that are not widely known or understood. Commonly used abbreviations, such as “USA” or “NASA”, do not need to be defined with the <abbr> tag.