Template:FontColor: Difference between revisions

From Atomix
mNo edit summary
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 9: Line 9:
}}
}}
</pre>
</pre>
You must specify the fonts using names (yellow,red) or [[https://meta.wikimedia.org/wiki/Help:Text_color|hexadecimal form]]
You must specify the fonts using names (yellow,red) or [https://meta.wikimedia.org/wiki/Help:Text_color hexadecimal form]. Note that background (bg) or foreground (fg) can be left empty.
Edit the page to see the template text.
</noinclude><includeonly>
{{#if: {{{fg|}}} | | {{{fg|black}}}}}
<span style="color:{{{fg|}}}; background:{{{bg|}}}">{{{text|}}}</span>


For example, <nowiki>{{FontColor|fg=white|bg=purple|text=this is white text on purple background}}</nowiki> yields {{FontColor|fg=white|bg=purple|text=this is white text on purple background}}.


[[Category:Help]]
Edit the page to see the template text.
</includeonly>
</noinclude><includeonly><span style="color:{{{fg|}}}; background:{{{bg|}}}">{{{text|}}}</span></includeonly>

Latest revision as of 00:53, 17 December 2021

This is the "FontColor" template. It should be called in the following format:

{{FontColor
|fg=
|bg=
|text=
}}

You must specify the fonts using names (yellow,red) or hexadecimal form. Note that background (bg) or foreground (fg) can be left empty.

For example, {{FontColor|fg=white|bg=purple|text=this is white text on purple background}} yields this is white text on purple background.

Edit the page to see the template text.