模板:Color swatch

維基百科,自由的百科全書
{{{4}}}

{{{2}}}

文件圖示 模板文件[檢視] [編輯] [歷史] [清除快取]

模板介紹[編輯]

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


範例[編輯]

注意事項[編輯]

參見[編輯]

給模板編輯者的說明[編輯]

模板結構[編輯]

實現方法[編輯]

編輯注意[編輯]