Template:Color swatch
{{{4}}}
{{{2}}}
模板介紹
编辑Creates a color swatch for use in articles.
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
Color | 1 | Color, as a CSS-compatible color.
| 字符串 | 必需 |
Title | 2 | The main caption. Appears once, beneath the swatch. Adding a reference is recommended.
| 单行文本 | 必需 |
Float | 3 | Specifies the direction to float, if any: "left", "right" or "center". (Note that centering is not technically floating.)
| 字符串 | 可选 |
Custom CSS | style | Advanced. Custom CSS code to be applied to the outer <div> element. | 字符串 | 可选 |
Internal caption | 4 | Optional; appears in the swatch and below the title. | 单行文本 | 可选 |
Text color | 5 | The color of the text that is overlayed onto the swatch.
| 字符串 | 可选 |
使用方法
编辑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
範例
编辑注意事项
编辑參見
编辑给模板编辑者的说明
编辑模板结构
编辑实现方法
编辑编辑注意
编辑上述文档嵌入自Template:Color swatch/doc。 (编辑 | 历史) 编者可以在本模板的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模板的子页面。 |