Difference between revisions of "Template:Color box"

From Backstage Lore Wiki
Jump to: navigation, search
m (Protected "Template:Color box" [edit=sysop:move=sysop])
(added padding attribute to adjust internal padding)
 
Line 1: Line 1:
<div style="background-color:{{{color|#000}}};border:1px solid {{{border|#888}}};border-left-width:5px;font-style:italic;text-align:left;padding:1em; overflow:hidden;color:{{{text|#fff}}}">{{{1}}}</div><noinclude>
+
<div style="background-color:{{{color|#000}}};border:1px solid {{{border|#888}}};border-left-width:5px;font-style:italic;text-align:left; padding:{{{padding|1em}}} {{{padding|1em}}} {{{padding|1em}}} 1em; overflow:hidden;color:{{{text|#fff}}}">{{{1}}}</div><noinclude>
 
==Example==
 
==Example==
 
The 'color' parameter is the background color.  The 'border' parameter is the border color.  The background color should be a darker shade of the border color.  If the background color is not dark, the white text may be difficult to read.  In that case, use a black text by setting the 'text' parameter.
 
The 'color' parameter is the background color.  The 'border' parameter is the border color.  The background color should be a darker shade of the border color.  If the background color is not dark, the white text may be difficult to read.  In that case, use a black text by setting the 'text' parameter.
The first unnamed parameter is the text to appear in the box.
+
The first unnamed parameter is the text to appear in the box.  The 'padding' parameter is the box padding.  Increasing the padding will make the box taller.  Reducing the padding will make the box shorter.
  
 
<nowiki>{{Color box|color=#144f1d|border=#2f8f2f|I made a colorful box!}}</nowiki>
 
<nowiki>{{Color box|color=#144f1d|border=#2f8f2f|I made a colorful box!}}</nowiki>
Line 12: Line 12:
 
<nowiki>{{Color box|color=#c0f|border=#a0f|text=#000|Too light}}</nowiki>
 
<nowiki>{{Color box|color=#c0f|border=#a0f|text=#000|Too light}}</nowiki>
 
{{Color box|color=#c0f|border=#a0f|text=#000|Too light}}
 
{{Color box|color=#c0f|border=#a0f|text=#000|Too light}}
 +
 +
<nowiki>{{Color box|color=#008800|border=#00aa00|text=#000|padding=0em|This has 0em padding}}</nowiki>
 +
{{Color box|color=#008800|border=#00aa00|text=#000|padding=0em|This has 0em padding}}
  
 
[[Category:Templates|{{PAGENAME}}]]</noinclude>
 
[[Category:Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 15:09, 14 October 2011

{{{1}}}

Example

The 'color' parameter is the background color. The 'border' parameter is the border color. The background color should be a darker shade of the border color. If the background color is not dark, the white text may be difficult to read. In that case, use a black text by setting the 'text' parameter. The first unnamed parameter is the text to appear in the box. The 'padding' parameter is the box padding. Increasing the padding will make the box taller. Reducing the padding will make the box shorter.

{{Color box|color=#144f1d|border=#2f8f2f|I made a colorful box!}}

I made a colorful box!

{{Color box|color=#205|border=#60b|And this one is purple.}}

And this one is purple.

{{Color box|color=#c0f|border=#a0f|text=#000|Too light}}

Too light

{{Color box|color=#008800|border=#00aa00|text=#000|padding=0em|This has 0em padding}}

This has 0em padding
Personal tools
Namespaces

Variants
Actions
Navigation
Tools