W3docs

HTML <abbr> Tag

The HTML <abbr> tag defines an abbreviation or an acronym, like "HTML", "Mr.", "Dec.", "ASAP", "ATM". Tip. Try some examples! Learn with W3docs HTML tutorial!

The browser renders the characters inside the <abbr> tag as an abbreviation or an acronym. To decipher the abbreviation, the global title attribute is used (displayed as a pop-up text prompt when you hover the mouse over the abbreviation).

The content of the <abbr> tag in some browsers can be marked with a dotted underline.

Syntax

The <abbr> tag comes in pairs. The content is written between the opening (<abbr>) and closing (</abbr>) tags.

Example of the HTML <abbr> tag:

HTML <abbr> Tag

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <p><abbr title="Universal Resource Locator">URL</abbr> - This is a specific way of designating an individual resource address on the Internet </p>
  </body>
</html>
Result

Attributes

The <abbr> tag supports the Global Attributes and the Event Attributes.

The most important attribute for this tag is title. It provides a tooltip with the full expansion of the abbreviation when the user hovers over it.

How to style an HTML <abbr> Tag

By default, browsers display a dotted underline for the <abbr> tag. You can customize or remove this style using CSS:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      abbr {
        text-decoration: none;
        border-bottom: 1px dotted #000;
        cursor: help;
      }
    </style>
  </head>
  <body>
    <p><abbr title="HyperText Markup Language">HTML</abbr> is the standard markup language for documents designed to be displayed in a web browser.</p>
  </body>
</html>

Practice

Practice

What is the function of the <abbr> tag in HTML?