Template:Colorbox/doc
No description yet available.
Usage
{{Colorbox |1= |2= |3= |title= }}
Legends and keys
The colorbox
template is widely used to annotate complex tables in which editors have used color to group like entries. The editor uses the background-color
style to color individual cells in the table and then adds a legend consisting of colorboxes at the beginning or end of the table explaining the meanings behind the color scheme. The editor should also add symbols like a caret (^), dagger/obelisk (†), double dagger/diesis (‡), or asterisk (*) to call attention to the different meanings, and make the table accessible for the color blind and in other cases where colors are not available (e.g. monochrome printing).
Visual effect | Markup |
---|---|
^ | {{colorbox|#CEF2E0|^}}
|
† | {{colorbox|#CEDFF2|†}}
|
‡ | {{colorbox|#DDCEF2|‡}}
|
* | {{colorbox|#F2E0CE|*}}
|
Note: The HTML code *
must be used to create the asterisk as Wikipedia will treat the typed asterisk as an indented bullet point.
Template parameters
Parameter | Description | Default | Status | |
---|---|---|---|---|
1 | background | Background color of the box. Colors are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See web colors for details. Note: Using black, blue, purple, or red colorbox obscures plain text, unvisited, visited, and missing wikilinks, respectively, as these are the default colors for most users. Such dark colors provide bad contrast ratio anyway, so you should use only light colors for accessible content. | white | suggested |
2 | text | Text displayed in the box. Displayed in default foreground color (usually black). | empty | optional |
3 | link | Target of the link in the box. If omitted or blank, the text in the box will not be linked. | empty | optional |
title | tooltip | Tooltip of the box | (value of background parameter) | optional |
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information
|
Additional information
The template is intended to be used in the following namespaces: no namespace specified
The template is intended to be used by the following user groups: no user group specified
See also
- Template:Swatch
- With {{Color}} also the color of the text can be defined (by the 1st parameter) - default like above
{{Colorbox|blue|text}}
gives the same as
{{Color|#000|bg=blue| text |css=border:1px solid #AAA}}
{{Colorbox|blue|link|w:}}
gives the same as
{{Color||bg=blue|[[w:link]]| text |css=border:1px solid #AAA}}
Localization
This template is not intended to be localized.
Examples
Visual effect | Markup |
---|---|
{{colorbox|Red}}
| |
Default color for this text | {{colorbox|Fuchsia|Default color for this text}}
|
Wikilink to the article on Wikipedia | {{colorbox|Yellow|Wikilink to the article on Wikipedia|Wikipedia:}}
|
Using an X11 color name | {{colorbox|Chartreuse|Using an '''{{W|X11 color names|X11 color name}}'''}}
|
same color as "#DC2" | {{colorbox|Rgb(86.7% 80% 13.3%)|same color as "#DC2"}} = dez. 221-204-34
|
Using RGB hex triplet | {{colorbox|#FEDCBA|''Using RGB hex triplet''|W:Web colors#Hex triplet}}
|
Wikilink to the German Wikipedia | {{colorbox|#CFE|Wikilink to the {{Wd||German Wikipedia}}}}
|
Wikilink to the German Wikipedia | {{Color|b|bg=#CFE| Wikilink to the {{Wd||German Wikipedia}} |css=border:1px solid #AAA}}
|