Template:Color swatch/doc

模板介紹

Creates a color swatch for use in articles.

模板参数

参数描述类型状态
Color1

Color, as a CSS-compatible color.

示例值
Red can be specified as "#FF0000" (without quotes).
字符串必需
Title2

The main caption. Appears once, beneath the swatch. Adding a reference is recommended.

示例值
Blue<ref>[ ... ]</ref>
单行文本必需
Float3

Specifies the direction to float, if any: "left", "right" or "center". (Note that centering is not technically floating.)

默认值
Left
字符串可选
Custom CSSstyle

Advanced. Custom CSS code to be applied to the outer <div> element.

字符串可选
Internal caption4

Optional; appears in the swatch and below the title.

单行文本可选
Text color5

The color of the text that is overlayed onto the swatch.

默认值
Black text.
示例值
If the color displayed is black, set this to e.g. "#FFFFFF", white.
字符串可选

使用方法

{{color swatch|#0000FF|Blue}} 的結果:

Blue


我們強烈建議使用本模版時應加入<ref>參考連結</ref>到主題,例如:

{{color swatch|#0000FF|Blue<ref>[http://www.w3.org/TR/REC-html40/types.html#h-6.5 HTML 4.01 Specification]</ref>}} 的結果:

Blue[1]


Optional parameters - floating left, and an internal caption:

{{color swatch|#0000FF|Blue|left|#0000FF}} creates:

#0000FF

Blue


Change the internal-caption's color with a 5th value:

{{color swatch|#0000FF|Blue|left|#0000FF|white}} creates:

#0000FF

Blue


範例

注意事项

參見

给模板编辑者的说明

模板结构

实现方法

编辑注意