Template:Box3/sandbox
Top[edit source]
Changes made in Template:box3 show up right away here when this sandbox page is reloaded, or with a null edit. That is where the page is opened for editing, nothing is changed, and the page is saved anyway.
View this page on a desktop PC and in a cell phone. Viewed on a cell phone the padding is different inside the colored boxes.
The order of the parameters does not matter:
{{Box3 | text= | link= | color= | background= |}
- "text" is the text seen by the reader.
- "link" is the URL under the text link.
- "color" is the color of the border.
- "background" is background color.
Bolding[edit source]
Bolding can be added later to text and links wrapped within this template.
'''{{box3|text=Portugal}}'''
Portugal
'''{{box3|link=Portugal}}'''
'''{{box3|link=Portugal|color=blue}}'''
Background color and border color[edit source]
Default background color is yellow. Default border color is red. Both can be changed:
{{box3|link=Portugal}}
{{box3|link=Portugal|background=honeydew}}
{{box3|link=Portugal|color=lime|background=honeydew}}
Some more background colors: peachpuff, palegreen, lightcyan.
Portugal Portugal Portugal
Wikipedia: Web colors. Named colors and hex colors work. Capitalization does not matter in named colors. Put # in front of hex colors. Spaces must be removed from hex numbers. The 3-digit shorthand versions of hex colors work too.
Border color:
Portugal Red (default).
Portugal Lime.
Portugal Green.
Portugal Blue.
Portugal Fuchsia.
Padding within the template is different on a cell phone versus on a desktop PC. So the above overlap is unavoidable in order to avoid worse problems when viewed on a cell phone.
Info[edit source]
See these discussions:
- Template box3. Reduce top border to 1px.
- Want to add named parameters to a link box template.
- Need a template for a blue link in a yellow box with a red border.
For Firefox-only wrapping problem see these discussions:
- Template is wrapping. Need non-breaking space or something.
- Firefox, unlike other browsers, has wrapping problem.
"border-radius"
in the template code determines how rounded the corners are.
Note: Nothing below is in tables in order to avoid the table CSS from overriding padding and other settings in Template:Box3.
Text only, no links[edit source]
{{box3|text=Portugal}}
PortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugalPortugal
Linked text[edit source]
{{box3|link=Portugal}}
Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal
With link, and blue border[edit source]
{{box3|link=Portugal|color=blue}}
Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal
With link, blue border, background color[edit source]
{{box3|link=Portugal|color=blue|background=peachpuff}}
Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal Portugal
Border color[edit source]
{{box3|link=Portugal|color=green}} Portugal
{{box3|link=[[Portugal]]|color=green}} Portugal
No border or yellow[edit source]
{{box3|link=Portugal|color=}} Portugal
{{box3|link=Portugal|color= }} Portugal
{{box3|link=Portugal|color=-}} Portugal
{{box3|link=Portugal|color=transparent}} Portugal
{{box3|link=Portugal|color=yellow}} Portugal
Links. Various formats[edit source]
[[Portugal]]
[[wikipedia:Portugal]]
http://en.wikipedia.org/wiki/Portugal
[http://en.wikipedia.org/wiki/Portugal]
No brackets. See last entry. Categories do not work[edit source]
{{Box3}}
{{box3|}}
{{box3||}}
{{box3|link=Portugal}} - "Portugal" linked. Portugal
{{box3|text=Portugal}} - "Portugal" unlinked. Portugal
Interwiki link plus label:
{{box3|link=wikipedia:Portugal|text=Portugal}}
Portugal
External link plus label:
{{box3|link=http://en.wikipedia.org/wiki/Portugal|text=Portugal}}
Portugal
External link as linked bare URL:
{{box3|link=http://en.wikipedia.org/wiki/Portugal|text=http://en.wikipedia.org/wiki/Portugal}}
http://en.wikipedia.org/wiki/Portugal
Unlinked black bold text:
{{box3|text=$4,753}}
$4,753
{{box3|link=Category:Flat list of templates|text=Flat list of templates}}
{{box3|link=:Category:Flat list of templates|text=Flat list of templates}} [[
- Category:Flat list of templates | Flat list of templates]]
Brackets. Note last entry. Categories do not work[edit source]
{{box3|link=[[Portugal]]}} Portugal
{{box3|link=[[wikipedia:Portugal]]|text=Portugal}} Portugal
{{box3|link=[http://en.wikipedia.org/wiki/Portugal]|text=Portugal}} Portugal
{{box3|link=[[:Category:Flat list of templates]]|text=Flat list of templates}} [[
- Category:Flat list of templates | Flat list of templates]]
Full bare URL by itself[edit source]
{{box3|link=http://en.wikipedia.org/wiki/Portugal}} [2]
{{box3|text=http://en.wikipedia.org/wiki/Portugal}} http://en.wikipedia.org/wiki/Portugal
Use text parameter (text=) with categories as internal links[edit source]
'''{{box3|text=[[:Category:Flat list of templates|<span style=color:blue;>Flat list of templates</span>]]}}'''
Use text parameter (text=) with complex mix of plain text and external links[edit source]
{{box3|text='''[http://cannabis.shoutwiki.com/wiki/Cities <span style=color:blue;>Cities</span>]''' and '''[http://cannabis.shoutwiki.com/wiki/Nations <span style=color:blue;>nations</span>]''' holding '''[http://cannabis.shoutwiki.com/wiki/420 <span style=color:blue;>4/20 events</span>]''' are also included in the maps and lists for later years.}}
Cities and nations holding 4/20 events are also included in the maps and lists for later years.
Using text parameter (text=) also works with complex mix of plain text and internal links[edit source]
{{box3|text='''[[Cities|<span style=color:blue;>Cities</span>]]''' and '''[[nations|<span style=color:blue;>nations</span>]]''' holding '''[[420 event lists|<span style=color:blue;>4/20 events</span>]]''' are also included in the maps and lists for later years.}}
Cities and nations holding 4/20 events are also included in the maps and lists for later years.
It will not work if you try to add the wikitext for bolding (''') around all of a complex mix. Bolding has to be added to the parts within.