Difference between revisions of "Template:Bgcolor"

From BlogNomic Wiki
Jump to navigation Jump to search
(creating a new markup template)
 
Line 27: Line 27:
 
| {{bgcolor|#aaffaa}}    | ?
 
| {{bgcolor|#aaffaa}}    | ?
 
| {{bgcolor|#ffaaff}}    | !
 
| {{bgcolor|#ffaaff}}    | !
|}</noinclude>
+
|}
 +
[[Category:Display templates]]</noinclude>

Revision as of 17:33, 3 August 2024

style="background-color:{{{1}}};"

Usage

This template generates CSS for table cell backgrounds, for use in wiki markup tables. It takes one or two colour inputs, which can be hex including the hash (eg. #69B3E7) or a web colour term (eg. aquamarine).

If only one colour is specified, the box background is that colour. If two are specified, the background shades a gradient from one to the other, top left to bottom right.

Example:

{| class="wikitable" style="text-align:center"
! !! A !! B
|-
! 1
| {{bgcolor|yellow}}     | O
| {{bgcolor|white|grey}} | X
|-
! 2
| {{bgcolor|#aaffaa}}    | ?
| {{bgcolor|#ffaaff}}    | !
|}

produces:

A B
1 O X
2 ? !