Template:Tooltip
Parameters
- 1: Tooltip title.
- 2: (Optional) Tooltip description/flavour text/lore.
- parentclass: (Optional) Parent element class.
Usage
A script displays the tooltip when the user hovers over the element this template is placed in. If JS isn't available, a standard browser tooltip with no formatting or description is shown.
This template doesn't output a HTML element, rather it outputs attributes which are are placed in a HTML element.
Standard formatting codes can be used in the tooltip (prefixed with &
rather than §
, and the description can also use /
to insert line breaks. All special characters (&
, \
, /
) can be escaped by prefixing them with a \
, including the backward slash itself.
Following newlines (/
), previous formatting codes persist.
Examples
<div {{Tooltip|Title|Some flavour text}} style="width:100px; height:100px; background-color:darkgrey">Parent container</div>
produces:
Parent container
{{Tooltip|&b&oIron Sword|&7Smite V/Fire Aspect I//&9+6 Attack Damage}}
produces:
Parent container
{{Tooltip |&nMinecraft Formatting | &00 &11 &22 &33/ &44 &55 &66 &77/ &88 &99 &aa &bb/ &cc &dd &ee &ff/ / &rk &kMinecraft/ &rl &lMinecraft/ &rm &mMinecraft/ &rn &nMinecraft/ &ro &oMinecraft/ &rr &rMinecraft/ / Escaping: \\ \/ \&0 }}
produces:
Parent container
{{Tooltip|&nMinecraft Formatting|&5Some text/Some other text}}
produces:
Parent container
The above documentation is transcluded from Template:Tooltip/doc. (edit | history)