Template:Abbr/doc

From Absit Omen Lexicon
Edit-copy green.png This is a documentation subpage for Template:Abbr.
It contains usage information, categories and other content that is not part of the original template page.

{{abbr}} is an abbreviation template. It works similarly to the HTML <abbr> or <acronym> tags.

Usage

{{abbr}} takes two unnamed parameters, in order:

  1. The short form, which shows as text on the page
  2. The long form, which the short form is an abbreviation for

Many web browsers (such as Firefox, Google Chrome, Internet Explorer, Opera, Safari) show the long form as a tooltip when a user hovers over the text. However, this behavior is not guaranteed and should not be relied on.

The template also has two named parameters:

  • |class=
  • |id=

which create the corresponding HTML attributes on the abbr element.


Examples

With two parameters

{{abbr|MSLP|Mean Sea Level Pressure}}

appears as here: MSLP. When hovering over the text "MSLP" then something like Mean Sea Level Pressure will appear as a tooltip in many (but not all) browsers. Popular screen readers, used by visually impaired readers, display the long form in a different way.


With named parameters

{{abbr|UK|United Kingdom|class=country-name|id=foobar}}

appears as UK.

Accessibility concerns

This template is intended for use with abbreviations; it is not intended to be a tool for generating tooltips. The wikipedia:Web Content Accessibility Guidelines contain guidelines for using the <abbr> element generated by this template; see section H28: Providing definitions for abbreviations by using the abbr and acronym elements.