This template uses block elements, e.g. See H:DIVSPAN for details. |
This template uses TemplateStyles: |
Usage edit
This specialized template creates a box to display text or combined text/images in; it creates a border around whatever you would like. Each property has a default so you do not need to define the setting if what you want is already the default.
You can embed other templates within this one (e.g. {{rule}} or {{sc}} or even another {{border2}}). However, some embedded templates that contain parameters, and things like tables, may cause this template to not work properly. In that case, use {{border2/s}} and {{border2/e}} instead.
Parameters edit
- 1: whatever goes in the box
- position: alignment of the box
- Options: left, center, right; default: center
- compact: whether the box should take only the width needed (if yes) or use the full page width (if no)
- Options: yes, no; default: yes
- class: additional CSS classes
- style: additional CSS styles
- attr: additional attributes for the box
- Example:
attr=id{{=}}"border-id"
- Example: in another template based on this one,
attr={{optional style|...}}
- Example:
Examples edit
Basic examples edit
Example: Default
{{border2|Your content here}}
Your content here
Example: All parameters
{{border2|position=|compact=|style=|class=|attr=| Your content here }}
Your content here
Example: Not compact
{{border2|compact=no| [[File:Philadelphia blackletter.svg|125px||link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. }}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
Example: Position and style
{{border2|position=right|style=padding:2.5em; border-color:black; color:black; background:white; max-width:20em;| [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{right|{{Mc}}CARTY & DAVIS, No. 171, MARKET STREET.}} }}
Example: Border2/s and Border2/e
{{border2/s|style=border:ridge 10px navy; text-align:center; padding:1em; border-radius:25px;}} [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. {{border/e}}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
Example: Ruled box
{{border2|style=border-left:none; border-right:none; padding:0;| [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. }}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
More examples edit
Example: Style
{{border2|style=max-width:25em; border-style:dashed; border-width:5px; text-align:center;| [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. }}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
Example: Position and style
{{border2|style=max-width:25%; border-width:2px; border-color:#00008B; background:thistle;|position=left| [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. }}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
Example: Style
{{border2|style=border:ridge 10px navy; background:#66FF99; text-align:center; padding:20px; border-radius:25px; color:navy;| [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. }}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
Double Border edit
There are two ways to make a double border. One is to use the standard "double border" feature of CSS. It is simple and only requires that border-style
be set to double
and border-width
be set to a value greater than 1px. Here is what this will look like:
Example: Standard double border
{{border2|style=border:double 2px; text-align:center;| [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. }}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
Example: Standard double border
{{border2|style=border:double 8px; text-align:center;| [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. }}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
Example: Standard double border
{{border2|style=border:double 20px; text-align:center;| [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. }}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
However, for more control, you may wish to use a border within another border:
Example: Creative/controllable
{{border2|style=border:2px solid darkred; background:#fff; color:darkcyan;| {{border2|style=border:5px dotted currentcolor; background:#FFEFD5; text-align:center;| [[File:Philadelphia blackletter.svg|125px|link=|alt=Philadelphia:]] {{Mc}}CARTY & DAVIS, No. 171, MARKET STREET. {{rule|3em}} 1834. }} }}
McCARTY & DAVIS, No. 171, MARKET STREET.
1834.
See also edit
- {{Frame}}
- {{Centered box}}
- {{Ruled box}}