Template:Border
Appearance
<{{#if:|div|span}} style="display:{{#if:|table-cell|inline-block}}; border:1px solid #ddd; {{#if:|line-height:;}} ">{{{1}}}</{{#if:|div|span}}>
File:Test Template Info-Icon - Version (2).svg Template documentationviewedithistorypurge
{{#ifeq:border |doc
|
{{#ifeq:show |show
|| icon | This is a documentation subpage for Template:Terminate sentence It may contain usage information, categories and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template |User |template template page |{{#if:Template |template page|article}}}}}}}}. |
}}{{#if:|
|{{#ifexist:Template:Border
| [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
|
}}
}}
|
}}
| Warning | This template is used on approximately 3,100 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 is used to place a customized border around text or an image. Note, to add a plain border to an image, use the |border parameter in [[File:...]] (see Wikipedia:Picture tutorial).
Syntax
Basic
Basic usage is {{border|element}}, where element is the text, image, etc. around which the border is to appear. The border will be a solid light grey color (#ddd) and 1px (1 pixel) wide by default (for custom settings; see below).
{{border|Abc}}→ <{{#if:|div|span}} style="display:{{#if:|table-cell|inline-block}}; border:1px solid #ddd; {{#if:|line-height:;}} ">Abc</{{#if:|div|span}}>
All options show:
{{border |element |display=display |width=width |style=style |style2=2nd style |color=color |lh=line height}}
{{border |Abc|width=2px|style=dotted |color=red}}→ <{{#if:|div|span}} style="display:{{#if:|table-cell|inline-block}}; border:2px dotted red; {{#if:|line-height:;}} ">Abc</{{#if:|div|span}}>
Parameters
- element
- (required) The element (image, text, etc) around which the border is to appear.
- display The element's display method
- inline-block (default if the parameter is not used), block, inline, table, flex, etc.
- width
- The width (thickness) of the border (default is
1px).
- style The border's style
- solid (default if the parameter is not used), dotted, dashed, double, groove, ridge, inset or outset.
- style2
- Additional CSS properties can be used in this template.
- color
- The border's color (default #ddd, otherwise recommend a named color).
Inline of element
- noinline
- Set
|{{SAFESUBST:#if:noinline|noinline=}}<anytext>to replace the defaultinline-blockdisplay style. - Some text <{{#if:|div|span}} style="display:{{#if:indeed|table-cell|inline-block}}; border:2px dotted #ddd; {{#if:|line-height:;}} ">Abc</{{#if:|div|span}}>
- Inline reading <{{#if:|div|span}} style="display:{{#if:|table-cell|inline-block}}; border:2px dotted #ddd; {{#if:|line-height:;}} ">Abc</{{#if:|div|span}}>
- div
- Set
|{{SAFESUBST:#if:div|div=}}<anytext>to wrap the template's content in{{#switch:pair
|c|close = |e|empty|s|single|v|void |o|open |p|pair = <{{#if:|div|div}}{{#if:| {{{attribs}}}}} }}{{#switch:pair |c|close = |e|empty|s|single|v|void = /> |o|open = > |p|pair = {{#ifeq:div|!--||>}}... }}{{#switch:pair |e|empty|s|single|v|void |o|open = |c|close |p|pair = {{#ifeq:div|!--|-->|</div>}} }}tags instead of the default{{#switch:pair |c|close = |e|empty|s|single|v|void |o|open |p|pair = <{{#if:|span|span}}{{#if:| {{{attribs}}}}} }}{{#switch:pair |c|close = |e|empty|s|single|v|void = /> |o|open = > |p|pair = {{#ifeq:span|!--||>}}... }}{{#switch:pair |e|empty|s|single|v|void |o|open = |c|close |p|pair = {{#ifeq:span|!--|-->|</span>}} }}tags. This is required if the template's content uses div tags or contains multiple lines of text.
See also
- {{color box}}
- {{legend inline}}
{{safesubst:#if:{{safesubst:#ifeq:Border|sandbox|1}}{{safesubst:#ifeq:Border|doc|1}}|| }}