Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Color box

Permanently protected template
From Wikipedia, the free encyclopedia

 

Template documentation[view] [edit] [history] [purge]
For the templates that display text in a colored box, see{{Divbox}} orTemplate:Mbox templates see also.
CSSThis template usesTemplateStyles:
WarningThis template is used onapproximately 85,000 pages and changes may be widely noticed. Test changes in the template's/sandbox or/testcases subpages, or in your ownuser subpage. Consider discussing changes on thetalk page before implementing them.

Usage

This is theTemplateData for this template used byTemplateWizard,VisualEditor and other tools.See a monthly parameter usage report forTemplate:Color box in articles based on its TemplateData.

TemplateData for Color box

{{color box|color|text|text color}}
Adds a rectangular color box.
  • Colors are most commonly specified as either a color keyword or as thehexadecimal triplet representing an RGB combination. See the articleweb colors for details.
  • If specified, the text is centered within the box.
ParameterDescriptionTypeStatus
Color1
Background color of the box.
Example
Green
Stringrequired
Text2
Adds text inside the box; box is otherwise an empty square.
Example
Hello, world!
Stringsuggested
Text color3
Sets the color of the text inside the box.
Default
Either black or white; whichever has greater contrast.
Example
Yellow
Stringsuggested
Border colorborder
Sets the color of the border around the box.
Default
black
Example
#FF0
Stringoptional

Format:inline

Adds a rectangular color box. Colors are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See the article web colors for details.If specified, the text is centered within the box.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Color1

Background color of the box.

Example
Green
Stringrequired
Text2

Adds text inside the box; box is otherwise an empty square.

Example
Hello, world!
Stringsuggested
Text color3

Sets the color of the text inside the box.

Default
Either black or white; whichever has greater contrast.
Example
Yellow
Stringsuggested
Border colorborder

Sets the color of the border around the box.

Default
black
Example
#FF0
Stringoptional
Examples
Visual effectMarkup
 {{color box|Green}}
 Default color for this text {{color box|Yellow|Default color for this text}}
 Default color for this text {{color box|Blue|Default color for this text}}
 Using X11 color names {{color box|SteelBlue|'''UsingX11 color names'''|Gold}}
 Using RGB hex triplets {{color box|#012345|''UsingRGB hex triplet''|#FEDCBA}}
 Red {{color box|Yellow|Red|#f00|border=#f00}}
 bordercolor like wikitable {{color box|white|bordercolor like wikitable|border=#A2A9B1}}

Variants

Color box templates
TemplateDescriptionExample
{{Color box}}Color box size with black borders and text color. Standard size.  or ORANGE 
{{Color box striped}}Striped color box. Standard size.     
{{RouteBox}}Borderless color box with text color andwikilinks. ORANGE 
{{Colorbull}}Colored bullet withwikilinks.
{{Legend inline}}Color box size with black borders. Standard size.  
{{Color sample}}Color box size with black borders. Smaller size.
{{Swatch inline}}orange
{{Background color}}orange
{{Rail color box}}A version with more display options. Part ofModule:Adjacent stations,Orange
{{Diagonal split color box}}Color box split diagonally. Standard size.
   
   

Supporting template

See also

The abovedocumentation istranscluded fromTemplate:Color box/doc.(edit |history)
Editors can experiment in this template'ssandbox(edit |diff) andtestcases(edit) pages.
Add categories to the/doc subpage.Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Color_box&oldid=1301824578"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp