Template:Color
跳转到导航
跳转到搜索
File:Test Template Info-Icon - Version (2).svg 模板文档[查看] [编辑] [历史] [清除缓存]
| 警告 | 此Template被引用於約55,000個頁面。 為了避免造成大規模的影響,所有對此Template的編輯應先於沙盒、測試樣例或您的沙盒上測試。 測試後無誤的版本可以一次性地加入此Template中,但是修改前請務必於討論頁發起討論。 模板引用數量會自動更新。 |
本模板用於取代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}},僅用於設定背景顏色