What is the <abbr>
tag in HTML and how is it used?
The <abbr>
tag in HTML is a semantic element used to represent an abbreviation or an acronym. It provides a way to specify a full description for abbreviations, which can be beneficial for accessibility and can help with search engine optimization (SEO).
Usage
The <abbr>
tag is used to wrap around the abbreviation, and the full form is provided using the title
attribute. This helps screen readers and other assistive technologies to understand the context better.
Example
<p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p>
In the above example, "WHO" is an abbreviation for "World Health Organization". When you hover over "WHO" in a browser, it usually shows the full form in a tooltip, and screen readers will read out the full title.
Accessibility
Using the <abbr>
tag improves accessibility as it provides context to users who might not be familiar with the abbreviation, including those using assistive technologies.
SEO Benefits
By providing the full form of an abbreviation, search engines can better understand the content of a page, potentially improving search rankings for relevant terms.