Template:Abbr/doc

From MozillaWiki
< Template:Abbr
Revision as of 21:14, 26 August 2014 by Lakrits (talk | contribs) (Created a documentation page for Template:Abbr (from Wikipedia (en)).)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Edit-copy green.svg
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.

This template is a front-end for the HTML element <abbr> used by most web browsers to create a tooltip giving the meaning of an abbreviation or an acronym.

Do not use <abbr> to mark up material other than abbreviations. Using it to generate tooltips in other case is an abuse of the underlying HTML and an accessibility problem.

Usage

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

  1. short form: the abbreviation or acronym, shows as text.
  2. long form: the meaning of the short form, shows as the tooltip.

Examples

What you write What is displayed Comment
{{abbr|MSLP}} MSLP
{{abbr|Mean Sea Level Pressure}} Mean Sea Level Pressure
{{abbr|MSLP|Mean Sea Level Pressure}} MSLP

When hovering over the text underlined with a dotted line, "MSLP" in the table above, then something like Mean Sea Level Pressure will appear as a tooltip in most browsers. Popular screen readers, used by visually impaired readers, display the long form in a different way.

Accessibility concerns

This template is intended for use with abbreviations; it is not intended to be a tool for generating tooltips. The 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.