Difference between revisions of "Template:Box"

From CWCki
Jump to navigation Jump to search
m
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{| cellspacing="0" cellpadding="0" style="border: 1px solid {{{border|rgb(125, 106, 141)}}}; margin: 10px auto; padding: 0pt; text-align: left; width: {{{width|450}}}px; background-color: {{{bg|rgb(224, 190, 253)}}}; color: {{{color|rgb(0, 0, 0)}}}"
{| style="background:{{{background|{{{bg|#FCF5FF}}}}}}; border:1px solid {{{border|#B6A3BF}}}; border-top:8px solid {{{border_head|{{{head_bg|{{{border|#B6A3BF}}}}}}}}}; color:{{{color|#000}}}; width:100%; max-width:{{{width|618}}}px; margin:0 auto 16px;"
| <div style="border-bottom: 1px solid {{{border|rgb(125, 106, 141)}}}; background-color: {{{head_bg|{{{border|rgb(125, 106, 141)}}}}}}; font-size: 1px; height: 8px;"></div>
|- style="vertical-align:top;"
<div class="box_image" style="margin: 5px 8px 8px; float: left; border:{{{img_border|1px solid rgb(127,127,127)}}};">
| style="padding:5px;" | {{#if:{{{img_border|}}}|<div style="border:{{{img_border|}}}">}}[[File:{{{image|delayclose.jpg}}}|{{{img_width|90}}}px]]{{#if:{{{img_border|}}}|</div>}}
[[Image:{{{image|delayclose.jpg}}}|{{{img_width|100}}}px]]
| style="padding:0 5px 0 1px; width:100%;" |<div style="font-size:1.25em; margin:0">'''{{{title|I am a box}}}'''</div>
</div>
----
<div style="border-bottom: 1px solid rgb(170, 170, 170); padding: 5px; font-family: Verdana; font-style: normal; font-variant: normal; font-size: 13pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-weight: bold; text-align: right; color: {{{color|rgb(0, 0, 0)}}}">{{{title|I am a box}}}
<div style="margin-bottom:0">{{{text|I cram key points into a nutshell.}}}</div>
</div>
|}<noinclude>{{usage|1=This template is a metatemplate used to create various box templates, such as [[:Category: Infoboxes|Infoboxes]], [[:Category:Navigational templates|Navigation Boxes]], and [[:Category: Article message boxes|Message Boxes]]. The format for using this template is as follows:
{{{text|I contain lots of interesting things}}}
|}<noinclude>
<br style="clear:both" />


== Generic box template ==
<code><nowiki>{{</nowiki>{{PAGENAME}}<nowiki>}}</nowiki></code> Displays:
Parameters:
 
* '''title''' - The box title. Default: "I am a box"  
{{Box}}
* '''text''' - The box text. Default: "I contain lots of interesting things "
 
* '''image''' - The image on the left of the box. Default: "delayclose.jpg"
==Default Parameters==
** '''img_border''' - CSS for the border around the image. Default: "1px solid rgb(127,127,127)"
 
** '''img_width''' - The images desired width. Default: "100"
* <code>title</code> - The box title. Default: "I am a box"
* '''border''' - Colour for the box border. Default: "rgb(125, 106, 141)"
* <code>text</code> - The box text. Default: "I cram key points into a nutshell."
* '''head_bg''' - Colour of the box head. Default: Same as ''border''
* <code>image</code> - The image on the left of the box. Default: "delayclose.jpg"
* '''bg''' - Background colour of the box. Default: "rgb(224, 190, 253)"
** <code>img_border</code> - CSS rule for the border around the image. Default: ''no border''
* '''width''' - Width of the box. Default: "450"
** <code>img_width</code> - The image's desired width in pixels. Default: 90 pixels
* '''color''' - Text color for the box text. Default: "rgb(0, 0, 0)"
* <code>border</code> - Colour for the box border. Default: "#B6A3BF"
** <code>border_top</code> (formerly <code>head_bg</code>) - Colour of the box head. Default: Same as <code>border</code>
* <code>background</code> (formerly <code>bg</code>) - Background colour of the box. Default: "#FCF5FF"
* <code>width</code> - Width of the box. Default: 618 pixels
* <code>color</code> - Text color for the box text. Default: black
 
Note that you can use sRGB (rgb(255, 0, 0)), Hex triplet (#FF0000), or the name of the color (red) when entering colors in the template. 


== Example Box ==
== Example Box ==
<pre><nowiki>{{box
<pre>{{box
|title=Example Box
|title=Example Box
|text='''This box.''' It is an ''example''.
|text='''This box.''' It is an ''example''.
Line 31: Line 34:
|img_width=120
|img_width=120
|border=rgb(0, 43, 184)
|border=rgb(0, 43, 184)
|head_bg=rgb(231, 165, 86)
|head_bg=#F08844
|bg=rgb(186, 0, 0)
|bg=Red
|width=300
|width=300
|color=rgb(186, 215, 134)
|color=rgb(186, 215, 134)
}}</nowiki></pre>
}}</pre>


Will create...
Will create...
Line 46: Line 49:
|img_width=120
|img_width=120
|border=rgb(0, 43, 184)
|border=rgb(0, 43, 184)
|head_bg=rgb(231, 165, 86)
|head_bg=#F08844
|bg=rgb(186, 0, 0)
|bg=Red
|width=300
|width=300
|color=rgb(186, 215, 134)
|color=rgb(186, 215, 134)
Line 53: Line 56:


== Use in sidebar ==
== Use in sidebar ==
<pre><nowiki><div style="clear:right; float:right; width:220px;"> {{Box
<pre><div style="clear:right; float:right; width:220px;"> {{Box
|bg = rgb( 255, 255, 255 )
|bg = rgb( 255, 255, 255 )
|head_bg = #DDAACC
|head_bg = #DDAACC
Line 62: Line 65:
|img_width = 74
|img_width = 74
|width = 220
|width = 220
}}</div></nowiki></pre>
}}</div></pre>
<div style="clear:right; float:right; width:220px;"> {{Box
<div style="clear:right; float:right; width:220px;"> {{Box
|bg = rgb( 255, 255, 255 )
|bg = rgb( 255, 255, 255 )
Line 73: Line 76:
|width = 220
|width = 220
}}</div>
}}</div>


Will look like this ▶
Will look like this ▶


220px is the de facto standard sidebar width. Don't change it if it is not necessary.  
220px is the de facto standard sidebar width. Do not change this width if it is not necessary.  
}}


[[Category: Templates]]
[[Category:Metatemplates|{{PAGENAME}}]]</noinclude>
</noinclude>

Latest revision as of 11:59, 30 July 2020

Delayclose.jpg
I am a box

I cram key points into a nutshell.

Usage

These usage notes will not be included in articles bearing this template.

This template is a metatemplate used to create various box templates, such as Infoboxes, Navigation Boxes, and Message Boxes. The format for using this template is as follows:

{{Box}} Displays:

Delayclose.jpg
I am a box

I cram key points into a nutshell.

Default Parameters

  • title - The box title. Default: "I am a box"
  • text - The box text. Default: "I cram key points into a nutshell."
  • image - The image on the left of the box. Default: "delayclose.jpg"
    • img_border - CSS rule for the border around the image. Default: no border
    • img_width - The image's desired width in pixels. Default: 90 pixels
  • border - Colour for the box border. Default: "#B6A3BF"
    • border_top (formerly head_bg) - Colour of the box head. Default: Same as border
  • background (formerly bg) - Background colour of the box. Default: "#FCF5FF"
  • width - Width of the box. Default: 618 pixels
  • color - Text color for the box text. Default: black

Note that you can use sRGB (rgb(255, 0, 0)), Hex triplet (#FF0000), or the name of the color (red) when entering colors in the template.

Example Box

{{box
|title=Example Box
|text='''This box.''' It is an ''example''.
|image=Kaguyads.jpg
|img_border=2px solid rgb(224, 190, 253)
|img_width=120
|border=rgb(0, 43, 184)
|head_bg=#F08844
|bg=Red
|width=300
|color=rgb(186, 215, 134)
}}

Will create...

Kaguyads.jpg
Example Box

This box. It is an example.

Use in sidebar

<div style="clear:right; float:right; width:220px;"> {{Box
|bg = rgb( 255, 255, 255 )
|head_bg = #DDAACC
|border = #B58BA7
|title = SUICIDE ALERT
|text = my name is ryan-chan sonichu lol
|image = ryancashix1.png
|img_width = 74
|width = 220
}}</div>
Ryancashix1.png
SUICIDE ALERT

my name is ryan-chan sonichu lol

Will look like this ▶

220px is the de facto standard sidebar width. Do not change this width if it is not necessary.