Skip to content
Marcos Caceres edited this page Mar 28, 2026 · 7 revisions

data-abbr

Applies to: <dfn>

Automatically generates an <abbr> element after the definition, showing the abbreviation in parentheses. ReSpec generates the abbreviation from the term's initial letters if no value is provided.

Usage

<dfn data-abbr>user agent</dfn>
<!-- Renders as: user agent (UA) -->
<dfn data-abbr="PoS">point of sale</dfn>
<!-- Renders as: point of sale (PoS) -->

Notes

  • With no value (or empty string), ReSpec generates the abbreviation from the capitalized initial letters of the term: "user agent" → "UA"
  • With an explicit value, that value is used as-is
  • The <abbr> element added uses the full term as its title attribute, enabling screen reader and hover tooltip support
  • The abbreviation is automatically added as an alias (data-lt) on the <dfn>, so [=UA=] will link to the definition of "user agent" without needing a separate alias declaration

Guides

Configuration options

W3C Configuration options

Linting rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

HTML attributes

CSS Classes

Special properties

Clone this wiki locally