Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Color box: Difference between revisions

Template page
No edit summary
Change default background-color to transparent. Change default text color to inherit.
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<div style="margin:0;background-color:{{{color|#000}}};border:1px solid {{{border|#888}}};border-left-width:5px;font-style:italic;text-align:left;padding:1em 1em 1em 1em; overflow:hidden;color:{{{text|#fff}}}">{{{1}}}</div><noinclude>
<div style="
==Example==
margin: 0.2em auto;
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.
border: 2px solid {{{border|#888888}}};
The first unnamed parameter is the text to appear in the box.
padding: 0.8em;
 
width: {{{width|auto}}};
<nowiki>{{Color box|color=#144f1d|border=#2f8f2f|I made a colorful box!}}</nowiki>
overflow: hidden; /* To stop the div from overlapping floating elements. */
{{Color box|color=#144f1d|border=#2f8f2f|I made a colorful box!}}
background-color: {{{color|transparent}}};
 
text-align: {{{align|left}}};
<nowiki>{{Color box|color=#205|border=#60b|And this one is purple.}}</nowiki>
color: {{{text|inherit}}};
{{Color box|color=#205|border=#60b|And this one is purple.}}
{{#ifeq: {{{italics}}} | no
 
| font-style: normal;
<nowiki>{{Color box|color=#c0f|border=#a0f|text=#000|Too light}}</nowiki>
| font-style: italic;
{{Color box|color=#c0f|border=#a0f|text=#000|Too light}}
}}
 
">{{{1|Example text}}}</div><noinclude>
[[Category:Template|{{PAGENAME}}]]</noinclude>
{{documentation}}
</noinclude>