Template:Color: Difference between revisions
From FrathWiki
Jump to navigationJump to search
(Created page with "<includeonly><span style="display: inline-block; border:1px solid #7f7f7f; width: 16px; height: 16px; color: {{{1|transparent}}}"></span></includeonly><noinclude> This template ...") |
(removing TOC since it is such a short page, seems unnecessary) |
||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><span style="display: inline-block; border:1px solid #7f7f7f; width: 16px; height: 16px; color: {{{1|transparent}}}"></span></includeonly><noinclude> | <includeonly>{{ #if: {{{2|}}} |<span style="color: {{{1|transparent}}};">{{{2}}}</span>|<span style="display: inline-block; border:1px solid #7f7f7f; width: 16px; height: 16px; background-color: {{{1|transparent}}};" title="{{{1|transparent}}}"></span>}}</includeonly><noinclude> | ||
__NOTOC__ | |||
This template has two uses: First, to display a small colored box, and second, to display colored text. | |||
==Colored box== | |||
==Examples== | If you specify only the first parameter, a color in a format which is understood by CSS, this template displays a small box filled with this color. When hovering over it, the name of the color is displayed in a tooltip. The parameter defaults to transparent. | ||
===Examples=== | |||
{{Color|red}} — red | {{Color|red}} — red | ||
Line 11: | Line 15: | ||
{{Color|rgb(20, 250, 180)}} — rgb(20, 50, 80) | {{Color|rgb(20, 250, 180)}} — rgb(20, 50, 80) | ||
{{Color|transparent}} — transparent}} | {{Color|transparent}} — transparent | ||
==Colored text== | |||
If you specify two parameters, the text in the second parameter is displayed in the color specified in the first parameter, which must be in a format understood by CSS. | |||
===Example=== | |||
{{Color|red|BADGERS}} — <tt><nowiki>{{Color|red|BADGERS}}</nowiki></tt> | |||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 12:05, 8 August 2014
This template has two uses: First, to display a small colored box, and second, to display colored text.
Colored box
If you specify only the first parameter, a color in a format which is understood by CSS, this template displays a small box filled with this color. When hovering over it, the name of the color is displayed in a tooltip. The parameter defaults to transparent.
Examples
— red
— #60f
— rgb(20, 50, 80)
— transparent
Colored text
If you specify two parameters, the text in the second parameter is displayed in the color specified in the first parameter, which must be in a format understood by CSS.
Example
BADGERS — {{Color|red|BADGERS}}