Template:Box/doc
This is a documentation subpage for Template:Box. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This template uses Lua: |
Basic usage
{{box|Contents}}
produces:
Parameters
Parameter | Description | Values |
---|---|---|
|type=
|
The type of box | black , white or transparent
|
|span=
|
Uses span tags instead of div tags | yes |
|wide=
|
Set the box to be as wide as the page/table | yes
|
|inline=
|
Set the box to be inline | text text text yes text text text
|
|header=
|
Adds an optional header | Header
Text |
|shadow=
|
Add a shadow to the box | yes
|
Parameter | Description | Default | CSS |
---|---|---|---|
"content"
|
The contents of the box (Necessary) | ||
opt1|background= opt2 |color=
|
The color of the background of the box | White | background-color |
|align=
|
The alignment of the box (left, center, right) (Recommended) | left | float |
|padding=
|
The inner padding of the border | 3px | padding |
|style=
|
The style of the border | Solid | border-style |
|border color=
|
The color of the border | Black | border-color |
|border size=
|
The size of the border | 3px | border-width |
|text align=
|
The alignment of the text (Recommended) | left | text-align |
|spacing=
|
The spacing of the letters | letter-spacing | |
|font=
|
The font of the box's text | font-family | |
|font size=
|
The font size of the box's text | font-size | |
|text color=
|
The color of the text | black | text-color |
|margin=
|
The outer margin of the box (Only does horizontal when type isn't inline-block or block )
|
3px | margin |
|box type=
|
The type of box (inline, inline-block, block) | inline-block | display |
|height=
|
The height of the box | height | |
|width=
|
The width of the box | (The width of the text) | width |
|CSS=
|
Any Additional CSS you want to add
(make sure to add ; to end) |
Parameter | Description | Default | CSS |
---|---|---|---|
|top margin=
|
The top outer margin of the box (Only does horizontal when type isn't inline-block or block )
|
3px | margin-top |
|bottom margin=
|
The bottom outer margin of the box (Only does horizontal when type isn't inline-block or block )
|
3px | margin-bottom |
|left margin=
|
The left outer margin of the box (Only does horizontal when type isn't inline-block or block )
|
3px | margin-left |
|right margin=
|
The right outer margin of the box (Only does horizontal when type isn't inline-block or block )
|
3px | margin-right |
|top padding=
|
The top inner padding of the border | 3px | padding-top |
|bottom padding=
|
The bottom inner padding of the border | 3px | padding-bottom |
|left padding=
|
The left inner padding of the border | 3px | padding-left |
|right padding=
|
The right inner padding of the border | 3px | padding-right |
|radius=
|
Border radius | 0 | border-radius |
|max-height=
|
The maximum height of the box | max-height | |
|min-height=
|
The minimum height of the box | min-height | |
|max-width=
|
The maximum width of the box | max-width | |
|min-width=
|
The minimum width of the box | min-width |
Examples
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
{{box|A|background=red|text color=white}}
{{box|B|background=blue|text color=orange}}
{{box|C|background=black|text color=white|margin=0px|height=1em|width=40px|border color=yellow}}
{{box|spacing=5px|height=50px|DOG}}
{{box|background=yellow|align=center|border size=10px|radius=20px|text align=center|The quick brown fox jumps over the lazy dog}}
TemplateData
TemplateData for Box
<templatedata> { "params": { "1": { "description": "The contents of the box", "example": "Hello, world!", "suggested": true }, "header": { "description": "A heading for the box", "example": "Warning", "suggested": true }, "align": { "description": "The alignment of the box", "example": "center", "default": "left", "suggested": true }, "box type": { "description": "The type of box (css display) (block, inline-block or inline)", "example": "block", "autovalue": "inline-block" }, "wide": { "description": "If set to yes the box will be wide", "example": "yes", "type": "boolean", "default": "no", "autovalue": "" }, "inline": { "description": "Set to yes for the box type to be inline", "example": "yes", "type": "boolean", "default": "no" }, "style": { "description": "The style of the border", "default": "solid" }, "padding": { "description": "The padding of the box", "default": "3px" }, "top padding": { "description": "The top padding of the box" }, "bottom padding": { "description": "The bottom padding of the box" }, "left padding": { "description": "The left padding of the box" }, "right padding": { "description": "The right padding of the box" }, "border color": { "description": "The color of the box border", "example": "red", "type": "string", "default": "black" }, "radius" : { "description": "Border corner radius", "example": "5em", "default": "0" }, "type": { "description": "The type of box (black,white,transparent)", "example": "black" }, "border size": { "description": "The size of the border", "default": "3px" }, "color": { "aliases": [ "background" ], "description": "The color of background", "example": "black", "default": "white" }, "text color": { "description": "The color of the text", "example": "green", "default": "black" }, "text align": { "description": "The alignment of the text (css text-align)", "example": "center", "default": "left" }, "spacing": { "description": "The spacing of the letters" }, "font": { "description": "The font of the text" }, "font size": { "aliases": [ "text size" ], "description": "The size of the text" }, "margin": { "description": "The size of the box's margin", "example": "30px", "default": "3px" }, "top margin": { "description": "The size of the box's top margin" }, "bottom margin": { "description": "The size of the box's bottom margin" }, "left margin": { "description": "The size of the box's left margin" }, "right margin": { "description": "The size of the box's right margin" }, "height": { "description": "The height of the box", "example": "400px", "default": "the height of the contents plus the margin" }, "max-height": { "description": "The maximum height of the box", "example": "800px" }, "min-height": { "description": "The minimum height of the box", "example": "100px" }, "width": { "description": "The width of the box", "default": "the width of the text plus the margin or padding" }, "max-width": { "description": "The maximum width of the box" }, "min-width": { "description": "The minimum width of the box" }, "CSS": { "description": "Any additional CSS to use" } }, "description": "This template produces a variety of boxes from preset options and from CSS.", "format": "inline" } </templatedata>
Tracking category
See also