This template supersedes {{legend3}}.

Usage

edit

{{colorbox|background-color|Text|wikilink|color}}

  • Colors are most commonly specified as either a color name or as the hexadecimal triplet representing an RGB combination. See web colors for details.
  • Text is optional; it is displayed using (by default) the default style foreground color as prescribed by CSS. For most users this is black.
  • The wikilink parameter is also optional and specifies the article to which the text should point.
Examples
Visual effect Markup
  {{colorbox|red}}
Default color for this text {{colorbox|fuchsia|Default color for this text}}
Wikilink to "Article" on Wikipedia {{colorbox|yellow|Wikilink to "Article" on Wikipedia|Article}}
Using an X11 color name {{colorbox|chartreuse|'''Using an X11 color name'''|X11 color names}}
Using RGB hex triplet {{colorbox|#FEDCBA|''Using RGB hex triplet''|Web colors#Hex triplet}}
Controling the visibility of text color on a colored background
Using a blue, purple, or red background colorbox obscures unvisited, visited, and missing wikilinks, respectively, as these are the default link colors for most users.
Using a black colorbox with text markers obscures the text as the default style foreground color for most users is black.
Most background colors (except white and pale colors) will not be contrasting correctly with the default text or link colors.
For this reason, you should specify a contrasting color for the rendered text in the 4th parameter (the presence of a link in the 3rd parameter will be made signaled by a bottom dotted line, in the same color as text)
Text marker examples
Visual effect Markup
Inverted text {{colorbox|black|Inverted text||white}}
Inverted link {{colorbox|Inverted link|Help:link|white}}
Not a link {{colorbox|white|Not a link||blue}}
Effective link {{colorbox|Effective link|Help:link|blue}}

Legends and keys

edit

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 may also add symbols like a caret (^), dagger/obelisk (†), double dagger/diesis (‡), or asterisk (*) to call attention to the different meanings.

Text color examples
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.

Variants

edit

See also

edit
  • {{Infobox color}}, a infobox for the description of a color with many details