Difference between revisions of "Template:abbr"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
Line 1: Line 1:
<abbr {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} title="{{#tag:nowiki|{{#invoke:String|replace|{{{2|}}}|"|&quot;}}}}">{{{1|}}}</abbr>
+
<abbr {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} title="{{#tag:nowiki|{{#invoke:String|replace|{{{2|}}}|"|&quot;}}}}">{{{1|}}}</abbr><noinclude>
  
 
The {{tl|abbr}} template is used to write an abbreviation (including an acronym or initialism) with its expanded meaning. It is a wrapper for the {{w|HTML}} {{w|HTML element#General phrase elements|element}} abbr.
 
The {{tl|abbr}} template is used to write an abbreviation (including an acronym or initialism) with its expanded meaning. It is a wrapper for the {{w|HTML}} {{w|HTML element#General phrase elements|element}} abbr.

Revision as of 19:35, 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

text to display inline in the article

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}} 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.