Jump to content

Template:Tooltip/doc

From wikiNonStop
Revision as of 13:37, 18 June 2026 by Majestix (talk | contribs) (Created page with "{{Documentation subpage}} <!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: Wikipedia:Wikidata). --> {{COinS safe|n}} {{High-use}} {{Bot use warning|bots=User:AAlertBot}} {{Lua|Module:Check for unknown parameters}} {{Uses TemplateStyles|Template:Tooltip/styles.css}} This template may be used to generate a tooltip when hovering over marked text. '''Note:''' this template is #When not to use|§&nbsp...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:COinS safe

Template:Bot use warning

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 Tabbr 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 Tabbr for that instead.

Body text – The tooltip template should not be used within the body text of an article if possible (see ).

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 ‎</ref> 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 Template:Pval to remove dotted underline decoration (default: use dotted underline)
  • |link= – set to Template:Pval to link the tooltip to the value in param Template:Pval (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

Template data

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

Tooltip

A pop-up tooltip displayed on mouse-over.

Template parameters

ParameterDescriptionTypeStatus
Term1

Rendered in-line as normal text

Linerequired
Tooltip2

Shows as a pop-up, mouse-over tooltip

Stringrequired
Linklink

set to 'yes' to link the term to the article specified by Term

Default
no
Example
yes
Booleanoptional
Dotteddotted

applies the specified CSS directives to the content of parameter 1

Default
no
Example
yes
Booleanoptional
Stylestyle

applies the specified CSS directives to the content of parameter 1

Stringoptional
Classclass

Adds one or more CSS classes, separated by a blank

Stringoptional
IDid

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

Stringoptional

Notes

Maintenance categories

See also