Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  



























Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Usage  





2 Parameters  





3 Examples  



3.1  Abbr examples  





3.2  Tooltip example  







4 Linking  





5 Accessibility and validity  





6 Redirects  





7 Maintenance categories  





8 Template data  





9 See also  














Template:Tooltip






Anarâškielâ
Аԥсшәа
العربية
Արեւմտահայերէն

Bosanski
Буряад
ChiTumbuka
Dansk
الدارجة
ދިވެހިބަސް
فارسی
Gaeilge

Hausa
Հայերեն
Bahasa Indonesia
Íslenska
עברית
Ladin
Лезги
Magyar
مصرى
مازِرونی
Occitan
Oʻzbekcha / ўзбекча


Tok Pisin
Português
Română
Simple English
سنڌي
Slovenščina
کوردی
Suomi
 

 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



MediaWiki
Multilingual Wikisource
Wikispecies
Wikibooks
Wikidata
Wikinews
Wikisource
Wiktionary
 

















Permanently protected template

From Wikipedia, the free encyclopedia
 


Wikipedia uses two separate templates to generate tooltips. 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>...</abbr>. The {{tooltip}} template uses the <span>...</span> element to provide generic notes.

Only use {{abbr}}or<abbr> to mark up abbreviations (including acronyms and initialisms). Using it to generate tooltips elsewhere is a misuse of the underlying HTML and causes accessibility problems. For general-purpose tooltips, use {{tooltip}} instead.

Readers on mobile devices typically do not have a mouse to hover with, and so generally cannot see tooltip contents. As of 2023, more English Wikipedia page views occur on mobile than on desktop browsers.[1]

Usage

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

Parameters

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

Examples

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

Abbr examples

Accessible when used in addition to inline expansion
Markup Renders as
High school students staying overnight on the Louisiana School for the Deaf (LSD) campus can phone their parents using an American Sign Language (ASL) interpreter. Although fluent in {{abbr|ASL|American Sign Language}}, most students at {{abbr|LSD|Louisiana School for the Deaf}} prefer texting their parents directly.

High school students staying overnight on the Louisiana School for the Deaf (LSD) campus can phone their parents using an American Sign Language (ASL) interpreter. Although fluent in ASL, most students at LSD prefer texting their parents directly.

In the above example, each abbreviation is first expanded in the body text within parentheses. The template provides an additional way for some users to access the meaning later in the text. See MOS:ABBR for more information.

Less accessible when used in place of inline expansion
Markup Renders as
High school students staying overnight on the {{abbr|LSD|Louisiana School for the Deaf}} campus can phone their parents using an {{abbr|ASL|American Sign Language}} interpreter. Although fluent in {{abbr|ASL|American Sign Language}}, most students at {{abbr|LSD|Louisiana School for the Deaf}} prefer texting their parents directly.

High school students staying overnight on the LSD campus can phone their parents using an ASL interpreter. Although fluent in ASL, most students at LSD prefer texting their parents directly.

In the above example, all abbreviations are expanded via the template. This is discouraged because it is the only way for users to access the meaning. Users reading on a mobile device, reading a printout, or listening to a screen reader will likely not have access to the full meaning.

Least accessible when misused to create tooltip notes
Markup Renders as
High school students staying overnight on the {{abbr|LSD|Louisiana School for the Deaf}} campus can phone their parents using an {{abbr|ASL|American Sign Language}} {{abbr|interpreter|Although fluent in ASL, most students at LSD prefer texting their parents directly.}}.

High school students staying overnight on the LSD campus can phone their parents using an ASL interpreter.

In the above example, all abbreviations are expanded via the template, and an entire sentence is embedded via the template. It is the only way for users to access the meaning. A user reading on a mobile device, reading a printout, or listening to a screen reader will likely not have access to the full meaning of the abbreviation and will have no clear indication that the embedded footnote exists.

Tooltip example

Markup Renders as
[[WP:COI|{{tooltip|conflict of interest|in the specific sense employed in Wikipedia policy}}]]

Tooltips should not be used within the body text of an article if possible (see MOS:NOTOOLTIPS). 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. See Template:Glossary linkorTemplate:Cite book/doc for practical examples.

Linking

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 [[Knockout#Technical knockout|{{abbr|TKO|technical knockout}}]] TKO
Less compatible {{abbr|[[Knockout#Technical knockout|TKO]]|technical knockout}} TKO

Accessibility and validity

The {{Abbr}} template is intended only for use with abbreviations (including acronyms and initialisms).

The Web Content Accessibility Guidelines contain guidelines for using the <abbr> element generated by this template; see section H28: Providing definitions for abbreviations by using the abbr and acronym elements. HTML specifications (both those of the W3C and WHATWG) strictly define the <abbr> element as reserved for markup of abbreviations. Abusing it for mouse-over tooltips breaks our semantic markup and makes our content invalid HTML (it will falsely pass a basic automated validator test because such a tool can't tell that the logical application of the data to the structure isn't correct, only that tags are nested properly).

Redirects

The following template names will redirectto{{Abbr}}:

{{Tooltip}} is a separate template sharing the same documentation.

Maintenance categories

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

Generic tooltip displayed on mouse-over.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Term1

Shows as text

Linerequired
Tooltip2

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

Stringrequired
CSSstyle

applies the specified CSS directives to the content of parameter 1

Stringoptional
Classclass

Adds a one or more CSS classes

Stringoptional
IDid

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

Stringoptional

See also


Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Tooltip&oldid=1164887357"

Categories: 
Pages monitored by Wikipedia bots
Templates using TemplateStyles
Abbreviation templates
Wikipedia XHTML tag-replacing templates
Semantic markup templates
Hidden categories: 
Wikipedia template-protected templates
Templates not safe for use in citation templates
Templates using TemplateData
 



This page was last edited on 11 July 2023, at 17:54 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki