Difference between revisions of "Template:abbr"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
Line 23: Line 23:
  
 
{{abbr|LSD|Louisiana School for the Deaf}}
 
{{abbr|LSD|Louisiana School for the Deaf}}
 
  
 
When hovering over the text "{{abbr|LSD|Louisiana School for the Deaf}}", something like <span class="titlehint" style="border: 1px solid black; background-color: #FFFFFF; margin-right: 2px; padding: 1px 2px; font-size: smaller; box-shadow: 2px 2px 3px #A0A0A0;">Louisiana School for the Deaf</span> will appear as a tooltip in desktop browsers. Mobile devices may display a dotted line or other visual indicator of abbreviation, but ''will not'' provide the tooltip. No screen readers for the visually impaired will read the expansion by default; some provide an optional setting to read the expansion aloud.
 
When hovering over the text "{{abbr|LSD|Louisiana School for the Deaf}}", something like <span class="titlehint" style="border: 1px solid black; background-color: #FFFFFF; margin-right: 2px; padding: 1px 2px; font-size: smaller; box-shadow: 2px 2px 3px #A0A0A0;">Louisiana School for the Deaf</span> will appear as a tooltip in desktop browsers. Mobile devices may display a dotted line or other visual indicator of abbreviation, but ''will not'' provide the tooltip. No screen readers for the visually impaired will read the expansion by default; some provide an optional setting to read the expansion aloud.
  
 
{{w|Template:Abbr|See full documentation.}}
 
{{w|Template:Abbr|See full documentation.}}

Revision as of 19:38, 17 June 2025

The {{abbr}} template is used to write an abbreviation (including an acronym or initialism) with its expanded meaning. It is a wrapper for the HTML element abbr.

Readers on mobile devices typically do not have a mouse to hover with, and so generally cannot see tooltip contents.

Usage

{{abbr|text to display inline in the article|pop-up tip}}

Parameters

Two unnamed (positional) parameters (required) and three named parameters (optional):

  • 1 – the term to be explained; displays as text. Wiki markup is allowed but works more consistently when wrapping the template, see below for linking examples.
  • 2 – the tooltip/pop-up (no wiki or HTML markup allowed). The popup is created by an HTML title= attribute, so it cannot contain HTML (or markup that resolves to HTML when rendered). This includes simple things like ''italics''.
  • class – one or more CSS classes (space-separated if more than one)
  • id – an HTML ID must be unique on the entire page.
  • style – CSS to apply to the displayed text (no effect on tooltip/popup). Any style values with embedded blanks must be single-quoted

{{abbr|LSD|Louisiana School for the Deaf}} becomes

LSD

When hovering over the text "LSD", something like Louisiana School for the Deaf will appear as a tooltip in desktop browsers. Mobile devices may display a dotted line or other visual indicator of abbreviation, but will not provide the tooltip. No screen readers for the visually impaired will read the expansion by default; some provide an optional setting to read the expansion aloud.

See full documentation.