Template:Divbox: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
<templatestyles src="Divbox/styles.css" /><div class="metadata divbox divbox-{{{1|none}}}" style="{{#if:{{{radius|}}}|border-radius: {{{radius}}};}}"><div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{#if:{{{2|}}}|'''{{{2}}}'''}}</div> | <templatestyles src="Divbox/styles.css" /><div class="metadata divbox divbox-{{{1|none}}}" style="{{#if:{{{radius|}}}|border-radius: {{{radius}}};}}"><div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{#if:{{{2|}}}|'''{{{2}}}'''}}</div>{{{3|}}}</div><noinclude> | ||
{{{3|}}} | |||
</div><noinclude> | |||
{{Documentation}} | {{Documentation}} | ||
<!-- Add categories to the /doc subpage, not here! --> | <!-- Add categories to the /doc subpage, not here! --> | ||
</noinclude> | </noinclude> |
Latest revision as of 05:10, 20 August 2023
This template uses TemplateStyles: |
This template can be used to create simple, flexible coloured text background.
Please note that this is intended to be a decorative template and not for use on article pages, therefore it will not display on articles.
Purpose
Boxes may not always be appropriate; they can be obtrusive.
{{Divbox}} provides a straightforward method of presenting any text within a box. Colors are selected using a private style keyword, which sets both box border and background, already chosen to work together, in a visual sense.
The keyword none
puts your content inside an invisible box. This is available to offer the identical box model for your content, without a visible box.
This template may be used within another template; or as part of another page.
Usage
Template general syntax is as follows:
{{divbox|1=style|2=title|3=content|radius=}}
Parameters
- 1 (Style)
- Mandatory. Use any of the following:
- You can forgo "1=", as long as this is the first unnamed parameter in the list.
- 2 (Title)
- Optional. Plain text; appears strong and centered at top. You can forgo "2=", as long as this is the second unnamed parameter in the list.
- 3 (Content)
- Mandatory. Any text, including markup, that is to form the body of the message. You can forgo "3=", as long as this is the third unnamed parameter in the list, and the content does not contain an equals sign (=).
- radius
- Radius of the rounded edges, along with a valid unit, such as px, pt or em. The parameter works on styles that innately have both sharp or round edges, overriding their default edge roundness. You can forgo this entire parameter and its value; but if used, you cannot omit "radius=", which is case sensitive. However, like any named parameter, it may appear in any position (i.e. it does not need to be the last parameter).
Examples
What you see | What you type |
---|---|
gray: | {{divbox|gray|Lorem ipsum|Lorem ipsum dolor...}}
|
red: | {{divbox|radius=5px|red|Lorem ipsum|Lorem ipsum dolor...}}
|
navy: | {{divbox|radius=10px|navy|Lorem ipsum|Lorem ipsum dolor...}}
|
amber: | {{divbox|radius=15px|amber|Lorem ipsum|Lorem ipsum dolor...}}
|
Without a border or background: | {{divbox|none|Lorem ipsum|Lorem ipsum dolor...}}
|
Without title | {{divbox|navy||Lorem ipsum dolor...}}
|
Content contains '=': | {{divbox|lavender|Lorem ipsum|3=Lorem <span style="color:#F00;">ipsum</span> dolor...}}
|