模板:Color/doc
跳转到导航
跳转到搜索
| File:Edit-copy green.svg | 此页面是Template:Color的模板文档。 此页面可能包含了模板的使用说明、分类和其他内容。 |
本模板用于取代HTML span的前景颜色。接受RGB的16进制编码,例如:#C9E72A,或是任何的网页颜色的英文名称,如red, blue, green, moccasin, darkorchid。有关于HTML span的背景颜色,请参考{{background color}}
使用说明[编辑]
{{color|英文顏色名稱或是RGB 16進制編碼|文字}}
范例:
如果第二个参数被省略,将会显示下方文字:
处理效能[编辑]
本模板会产生下列的HTML span语法:
<span style="color:{{{1}}}">{{{2}}}</span>
处理速度大约每秒700次,与直接使用HTML语法几乎没有差异。
模板资料[编辑]
<templatedata> { "description": "The color template can be used to add a span of text with any given text color", "params": { "1": { "label": "Color", "description": "CSS name of color or hex code of color, e.g. 'red' or '#00F000'.", "type": "string", "required": true }, "2": { "label": "Text", "description": "The string of text to be formatted in the desired color", "type": "string", "suggested": true } } } </templatedata>
重定向[编辑]
- {{Colour}}
参见[编辑]
- {{resize}}
- {{font color}},用于设定文字颜色及背景颜色
- {{background color}},仅用于设定背景颜色