Template:Tooltip: Difference between revisions

(Created page with "<span class="explain" title="{{{2}}}">{{{1}}}</span><noinclude> Please note that using a quotation mark (") in the second parameter (the tool tip) will cause the template to ...")
Tag: sourceedit
 
({{shortcut}})
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<span class="explain" title="{{{2}}}">{{{1}}}</span><noinclude>
<includeonly><span class="tooltip" title="{{#tag:nowiki|{{{2}}}}}" style="text-decoration: underline; text-decoration-style: dotted">{{{1}}}</span></includeonly><noinclude>{{Documentation|content=
{{shortcut|template=1|tt}}
This template adds a dotted underline and a tooltip (passed as {{param|2}}) to a piece of text (passed as {{param|1}}). On desktop view, the tooltip shows when cursor hovers on the text. On mobile view, tapping on the text changes itself to the tooltip; tapping again changes it back to the original text.


Please note that using a quotation mark (") in the second parameter (the tool tip) will cause the template to display incorrectly. To display this character, use the {{wp|List of XML and HTML character entity references|html entity}} quot (i.e. write <code>&amp;quot;</code>) or put the second parameter in <code><nowiki><nowiki></nowiki></code> tags. [[Category:Code templates]][[pt:Predefinição:Tt]]</noinclude>
Any Wikitext and HTML markups (e.g. <code><nowiki>''italic''</nowiki></code>, <code>&lt;br&gt;</code>) in tooltip are escaped. To insert newlines, use the [[wikipedia:Character entity|character entity reference]] <code>&amp;#10;</code>, <code>&amp;#xA;</code>, <code>&amp;#xa;</code> or <code>&amp;NewLine;</code>.
 
Examples:
* <code><nowiki>{{tt|Text|Tooltip}}</nowiki></code> → {{tt|Text|Tooltip}}
* <code><nowiki>{{tt|Text|Tool<br>Tip}}</nowiki></code> → {{tt|Text|Tool<br>tip}}
* <code><nowiki>{{tt|Text|Tool&amp;#10;Tip}}</nowiki></code> → {{tt|Text|Tool&#10;Tip}}
}}[[Category:Formatting templates]]</noinclude>

Latest revision as of 20:10, 24 September 2025

Template-info.svg Template Documentation
Shortcut

This template adds a dotted underline and a tooltip (passed as {{{2}}}) to a piece of text (passed as {{{1}}}). On desktop view, the tooltip shows when cursor hovers on the text. On mobile view, tapping on the text changes itself to the tooltip; tapping again changes it back to the original text.

Any Wikitext and HTML markups (e.g. ''italic'', <br>) in tooltip are escaped. To insert newlines, use the character entity reference &#10;, &#xA;, &#xa; or &NewLine;.

Examples:

  • {{tt|Text|Tooltip}}Text
  • {{tt|Text|Tool<br>Tip}}Text
  • {{tt|Text|Tool&#10;Tip}}Text