模板:Color/doc

维基教科书,自由的教学读本


本模板用于取代HTML span的前景颜色。接受RGB的16进制编码,例如:#C9E72A,或是任何的网页颜色的英文名称,如red, blue, green, moccasin, darkorchid。有关于HTML span的背景颜色,请参考{{background color}}

使用说明[编辑]

  • {{color|英文颜色名称或是RGB 16进制编码|文字}}

范例:

Template:Tbullet Template:Tbullet

如果第二个参数被省略,将会显示下方文字:

Template:Tbullet Template:Tbullet

处理效能[编辑]

本模板会产生下列的HTML span语法:

<span style="color:{{{1}}}">{{{2}}}</span>

处理速度大约每秒700次,与直接使用HTML语法几乎没有差异。

模板资料[编辑]

这是用于新版可视化编辑器及其他工具的模板数据文档。

Color模板数据

The color template can be used to add a span of text with any given text color

模板参数

参数描述类型状态
Color1

CSS name of color or hex code of color, e.g. 'red' or '#00F000'.

字符串必需
Text2

The string of text to be formatted in the desired color

字符串推荐

重定向[编辑]

参见[编辑]