Difference between revisions of "Template:ColorBox"

From WikiCorporates
Jump to navigation Jump to search
Line 1: Line 1:
−
<span style="background-color:{{{1|}}}; color:{{#if:{{{3|}}}|{{{3}}}|{{greater color contrast ratio|{{{1|}}}|black|white}}}}; border:1px solid {{{border|{{{1}}}}}}; text-align:center;">{{#if:{{{2|}}}|&thinsp;{{{2}}}&thinsp;|&nbsp;&nbsp;&nbsp;&nbsp;}}</span><noinclude>{{doc2}}</noinclude>
+
<span style="background-color:{{{1|}}}; color:{{#if:{{{3|}}}|{{{3}}}|white}}}}; border:1px solid {{{border|{{{1}}}}}}; text-align:center;">{{#if:{{{2|}}}|&thinsp;{{{2}}}&thinsp;|&nbsp;&nbsp;&nbsp;&nbsp;}}</span><noinclude>{{doc2}}</noinclude>

Revision as of 23:38, 19 March 2020

    

[edit] Documentation

Template

Usage

{{ColorBox|colour|text|text colour|border colour}}

{{ColorBox
|Green           - background colour of the box
|Cat             - text in the box; otherwise an empty coloured square. Optional
|Blue            - colour of the text inside the box. Optional
|border=#fff000  - colour of the border around the box. Optional; default is the same colour as the bg.
}}
Examples
Visual effect Markup
     {{ColorBox|green}}
 Black for this text  {{ColorBox|yellow|Black for this text|black}}
 Default color for this text  {{ColorBox|blue|Default color for this text}}
 Using X11 color names  {{ColorBox|steelblue|'''Using X11 color names'''|gold}}
 Using RGB hex triplets  {{ColorBox|#012345|''Using RGB hex triplets''|#fedcba}}
 Red  {{ColorBox|yellow|Red|#f00|border=#f00}}

Source: Copied from Template:Color boxWikipedia-W.svg