Template:Tooltip - Wikipedia
Jump to content
From Wikipedia, the free encyclopedia
Template documentation
view
] [
edit
] [
history
] [
purge
This template
should not be used in
citation templates
such as
Citation Style 1
and
Citation Style 2
, because it includes markup that will pollute the
COinS
metadata they produce; see
Wikipedia:COinS
This template does
not
display in the mobile view of Wikipedia; it is
desktop only
. See
Template:Navbox visibility
for a brief explanation.
This template is used on
approximately 524,000 pages
To avoid major disruption and server load, any changes should be tested in the template's
/sandbox
or
/testcases
subpages, or in your own
user subpage
. The tested changes can be added to this page in a single edit. Consider discussing changes on the
talk page
before implementing them.
This template is used by one or more
bots
If you intend to change this template in any significant way, move it, or nominate it for deletion, please inform the bot operators. Thank you. The relevant bots are:
User:AAlertBot
This template uses
Lua
Module:Check for unknown parameters
sandbox
This template uses
TemplateStyles
Template:Tooltip/styles.css
This template may be used to generate a
tooltip
when hovering over marked text.
Note:
this template is
§ not to be used
for expanding
initialisms
or
acronyms
; see template
{{
abbr
}}
for that instead. See
§ Notes
for more details on access limitations for mobile and screen reader users.
Usage
{{Tooltip|
inline text
hover text
}}
{{Tooltip|
inline text
hover text
|dotted=no|link=yes|class=...|style=...|id=...}}
When not to use
Abbreviations
– The
{{
Tooltip
}}
template is
not
intended for use with abbreviations, including
acronyms
and
initialisms
); use template
{{
abbr
}}
for that instead.
Body text
– The tooltip template should not be used within the body text of an article if possible (see
MOS:NOTOOLTIPS
).
As footnotes
– Tooltips are not a substitute for
footnotes
. They are intended to be used for navigational and other secondary features where space is limited. See
Template:Glossary link
or
Template:Cite book/doc#Usage
for practical examples.
In citations
– Tooltips cannot be used inside
citation templates
. If you're tempted to put a tooltip in a citation, it may be better to place a plaintext note after the citation template but before the closing

tag, or use a
nested footnote
Parameters
There are two required positional parameters, and five optional named parameters:
|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''
|dotted=
– set to
no
to remove dotted underline decoration (default: use dotted underline)
|link=
– set to
yes
to link the tooltip to the value in param
(default: tooltip is unlinked)
These three parameters take the standard values as defined by
HTML
and
CSS
|class=
– one or more CSS classes (space-separated, enclosed in quotes)
|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, e.g.
|style=font-family: 'Times New Roman', serif;
Examples
{{
tooltip
TKO
technical knockout
}}
TKO
{{
tooltip
conflict of interest
COI as used in Wikipedia policy
dotted
no
}}
conflict of interest
{{
tooltip
תוכן נִסתָר
תוכן ברור
dotted
no
}}
תוכן נִסתָר
{{
tooltip
Sex gap
Difference in life expectancy for female and male
}}
Sex gap
{{
tooltip
'''$31,152,975'''
Career prize money
}}
$31,152,975
{{
tooltip
male
Assigned male at birth
}}
male
{{
tooltip
Cupronickel
75% copper, 25% nickel
}}
Cupronickel
{{
tooltip
dotted
no
}}
{{
tooltip
''Voyage with a Tail Wind''
simplified Chinese: 顺风相送; traditional Chinese: 順風相送; pinyin: Shùnfēng Xiāngsòng
dotted
no
}}
Voyage with a Tail Wind
Template data
This is the
TemplateData
for this template used by
TemplateWizard
VisualEditor
and other tools.
See a monthly parameter usage report
for
Template:Tooltip
in articles based on its TemplateData.
TemplateData for Tooltip
Template parameters
Edit template data
Parameter
Description
Type
Status
Term
Rendered in-line as normal text
Line
required
Tooltip
Shows as a pop-up, mouse-over tooltip
String
required
Link
link
set to 'yes' to link the term to the article specified by Term
Default
no
Example
yes
Boolean
optional
Dotted
dotted
applies the specified CSS directives to the content of parameter 1
Default
no
Example
yes
Boolean
optional
Style
style
applies the specified CSS directives to the content of parameter 1
String
optional
Class
class
Adds one or more CSS classes, separated by a blank
String
optional
ID
id
Adds an HTML id (must be unique in the page)
String
optional
Notes
This template is not available in the
mobile view of Wikipedia
, which lacks the hover feature. As of 2023,
more English Wikipedia page views occur on mobile than on desktop browsers
Screen readers
often have difficulty with plain hover pop-up text.
Maintenance categories
Category:Pages using tooltip with unknown parameters
(7)
See also
{{
Abbr
}}
{{
Dfn
}}
The above
documentation
is
transcluded
from
Template:Tooltip/doc
edit
history
Editors can experiment in this template's
sandbox
edit
diff
and
testcases
edit
pages.
Add categories to the
/doc
subpage.
Subpages of this template
Retrieved from "
Categories
Pages monitored by Wikipedia bots
Abbreviation templates
Wikipedia HTML tag-replacing templates
Semantic markup templates
Hidden categories:
Wikipedia template-protected templates
Templates not safe for use in citation templates
Lua-based templates
Templates using TemplateStyles
Templates using TemplateData
Template
Tooltip
Add topic