模板:Legend/doc

維基百科,自由的百科全書
跳至導覽 跳至搜尋

顯示一行圖例,並帶有顏色框。

用法[編輯]

{{legend|背景颜色|标签|outline=描边颜色|border=CSS边框}}
  • 背景颜色會傳入顏色框的CSSbackground-color屬性。
  • outline參數是可選的,表示框周邊的邊框的顏色。
  • border參數是可選的,會覆蓋outline參數,並設置框周圍顯示的CSS邊框(例如1px solid #aaa)。

示例[編輯]

{{legend|black|非洲}}
{{legend|green|美洲}}
{{legend|blue|大洋洲}}
{{legend|#ff0|歐洲}}
{{legend|#ff2800|亞洲}}
  非洲
  美洲
  大洋洲
  歐洲
  亞洲

完整參數列表[編輯]

{{legend
| 图例框的颜色
| 图例后跟随的文本
| outline   = 图例框周围的边框
| border    = 为边框指定自定义的CSS样式(覆盖outline)
| textcolor = “text”的颜色
| size      = “text”的文本大小
| text      = 图例框内的文本
}}

限制[編輯]

在參數|text=中使用特殊的字符可能會有未知的結果。例如,要在|text=中使用*,請使用|text={{asterisk}}。要在|text=中使用井號,請使用|text={{number sign}}

模板數據[編輯]

以下是該模板的模板資料,適用於視覺化編輯器等工具。

Legend模板資料

<templatedata> { "params": { "1": { "label": "顏色", "description": "圖例項的CSS顏色,以任何的CSS格式", "example": "\"#6D6E00\", \"#ffa\", \"yellow\"", "type": "line", "required": true }, "2": { "label": "標籤文本", "description": "圖例項的標籤", "example": "\"soda\" is most common", "type": "string", "suggested": true }, "border": { "label": "CSS border樣式", "description": "圖例項的邊框的CSS樣式", "type": "string" }, "outline": { "label": "項描邊", "description": "圖例項的描邊的CSS顏色", "example": "silver", "type": "line" }, "text": { "label": "項販的文本", "description": "Text to be displayed in the legend entry box, i.e. within the color specified", "example": "Af", "type": "line" }, "textcolor": { "label": "文本顏色", "description": "CSS color of text inside the legend's colored box", "type": "string" }, "size": {

           "label": "大小",

"description": "Font size of the legend entry, including colored box", "type": "string" } }, "description": "顯示一行圖例,並帶有顏色框。" } </templatedata>