DEV Community

Cover image for HTML tags | abbr
Carlos Espada
Carlos Espada

Posted on

HTML tags | abbr

It is used to define an abbreviation or an acronym.

It has an optional title attribute which, if present, must contain exclusively the complete description of the abbreviation or acronym (eg: <abbr title="HyperText Markup Language">HTML</abbr>).

This title attribute can be used by browsers to present a tooltip when hovering and can be displayed in various ways, usually with a dotted bottom border and sometimes with uppercase text. Any of these styles is modifiable by CSS.

Using <abbr> in a definition in the document does not link said definition to the same abbreviation or acronym in other parts of the text, it will be necessary to use <abbr> as many times as deemed appropriate. But it should not be added on all occasions when the term is presented, only when it is considered that it adds value to the user and is not redundant.

For accessibility reasons, it is often useful to use it at least the first time the term appears in the document, especially when the content is technical or includes special jargon.

  • Type: inline
  • Self-closing: No
  • Semantic value: No

Definition | Example | Support

Discussion (0)