Difference between revisions of "Template:Box"
Jump to navigation
Jump to search
(Added usage. Recategorized as Metatemplate.) |
Little Owl (talk | contribs) (Template modernised to fit smartphone screens.) |
||
| Line 1: | Line 1: | ||
{| | {| 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|600}}}px; margin:16px auto;" | ||
|- style="vertical-align:top;" | |||
| style="padding:5px;" | {{#if:{{{img_border|}}}|<div style="border:{{{img_border|}}}">}}[[File:{{{image|delayclose.jpg}}}|{{{img_width|90}}}px]]{{#if:{{{img_border|}}}|</div>}} | |||
[[ | | 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="margin-bottom:0">{{{text|I cram key points into a nutshell.}}}</div> | |||
</div> | |||
{{{text|I | |||
|}<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:<br /> | |}<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:<br /> | ||
'''<nowiki>{{</nowiki>{{PAGENAME}}<nowiki>}}</nowiki>''' | '''<nowiki>{{</nowiki>{{PAGENAME}}<nowiki>}}</nowiki>''' | ||
Displays: | |||
{{Box}} | |||
==Default Parameters== | |||
* <code>title</code> - The box title. Default: "I am a box" | |||
* | * <code>text</code> - The box text. Default: "I cram key points into a nutshell." | ||
* | * <code>image</code> - The image on the left of the box. Default: "delayclose.jpg" | ||
* | ** <code>img_border</code> - CSS rule for the border around the image. Default: ''no border'' | ||
** | ** <code>img_width</code> - The image's desired width in pixels. Default: 90 pixels | ||
** | * <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: 600 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. | 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. | ||
Revision as of 13:15, 11 March 2020
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:
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 borderimg_width- The image's desired width in pixels. Default: 90 pixels
border- Colour for the box border. Default: "#B6A3BF"border_top(formerlyhead_bg) - Colour of the box head. Default: Same asborder
background(formerlybg) - Background colour of the box. Default: "#FCF5FF"width- Width of the box. Default: 600 pixelscolor- 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...
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>
Will look like this ▶
220px is the de facto standard sidebar width. Do not change this width if it is not necessary.