Documentation icon Template documentation[view · edit · history · purge ]

The {{Tooltip}} template uses the <span>...</span> HTML element to provide generic notes for normal text. Please be mindful that visitors on mobile devices typically do not have a mouse to hover with, and so generally cannot see tooltip contents.

Usage edit

{{Tooltip|text to display inline on the page|pop-up tip}}

Parameters edit

This template has two (2) unnamed or positional parameters that must be defined, along with three (3) other named parameters that are optional:

Parameter Value
Required parameters
|1=
(or first unnamed parameter)
The normal text to be annotated. Wiki markup is allowed, but works more consistently when wrapping the template (see linking examples below).
|2=
(or second unnamed parameter)
The tooltip/hover text; no wiki or HTML markup allowed. The popup is created by an HTML title= attribute added to a <span>...</span> element, so it cannot contain HTML (or markup that resolves to HTML when rendered). This includes simple things like ''italics''.
Optional parameters
|class= One or more CSS classes (space-delimited, if more than one).
|id= An HTML id attribute value (must be unique on the entire page).
|style= CSS properties to apply to the displayed text (has no effect on tooltip/pop-up), each terminated with a semicolon. Any style values with embedded whitespace must be single-quoted, e.g. style=font-family: 'Times New Roman', serif;.

Examples edit

Markup Renders as
{{Tooltip|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.

Markup Renders as
[[wikipedia:Wikipedia:COI|{{Tooltip|Conflict of interest|in the specific sense employed in Wikimedia policy}}]]
Conflict of interest

Tooltips should not be used within the body text of an page, if possible. Generic tooltip notes are not a substitute for footnotes and are intended to be used for navigational and other secondary features where space is limited.

Linking edit

To wiki-link the abbreviation being marked up by this template, wrap the template in the link, or the tooltip will not appear in some browsers.

Compatibility Markup Renders as
Compatible [[wikipedia:Knockout#Technical knockout|{{Tooltip|TKO|Technical knockout}}]] TKO
Less compatible {{Tooltip|[[wikipedia:Knockout#Technical knockout|TKO]]|Technical knockout}} TKO

TemplateData edit

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Tooltip

Generic tooltip displayed on mouse-over.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Term1

Shows as text

Stringrequired
Tooltip2

Shows as a mouse-over tooltip; do not use markup

Stringrequired
CSSstyle

applies the specified CSS directives to the content of parameter 1

Lineoptional
Classclass

Adds a one or more CSS classes

Lineoptional
IDid

Adds an HTML id (must be unique in the page)

Lineoptional