แม่แบบ:Legend
หน้าตา
| มีการใช้แม่แบบนี้ประมาณ 980 หน้าและการแก้ไขอาจทำให้เกิดผลกระทบหรือสังเกตเห็นได้ ควรทดสอบการเปลี่ยนแปลงในกระบะทราย หรือหน้าทดสอบ หรือในหน้าย่อยผู้ใช้ของคุณเอง อนึ่ง อภิปรายเกี่ยวกับการแก้ไขแม่แบบได้ที่หน้าอภิปรายก่อนที่จะนำไปใช้ |
| แม่แบบนี้ใช้ TemplateStyles: |
แสดงคำอธิบายสัญลักษณ์ด้วยกล่องสี
การใช้งาน
{{legend|สีพื้นหลัง|คำอธิบาย|outline=outline color|border=css border}}
- สีพื้นหลัง สามารถใช้รหัสสี HTML หรือใช้ชื่อสีในภาษาอังกฤษก็ได้ ตามตัวอย่างข้างล่าง มันสามารถใส่ภาพไปได้ด้วย
- border หรือ พารามิเตอร์กรอบ ขึ้นอยู่กับคุณว่าจะใส่หรือไม่
ตัวอย่าง
ใช้ในข้อความปกติ
{{legend|black|แอฟริกา}}
{{legend|green|อเมริกา}}
{{legend|blue|โอเชียเนีย}}
{{legend|#ffa|ยุโรป|outline=silver}}
{{legend|#ff2800|เอเชีย|outline=#A2A9B1}}
แอฟริกา
อเมริกา
โอเชียเนีย
ยุโรป
เอเชีย
ใช้ในคำอธิบายภาพ
รายการพารามิเตอร์ทั้งหมด
{{legend
| [legend box's colo(u)r]
| [text following legend box]
| outline = <!--colo(u)r of border around legend box-->
| border = <!--use to specify custom CSS styling for border (overrides 'outline')-->
| color = <!--colo(u)r of 'text'-->
| size = <!--'text' font-size-->
| text = <!--to place text inside the legend box-->
}}
ข้อจำกัด
Using certain special characters in |text= that have meaning in wikitext can cause unexpected results. To use * in |text=, use |text={{asterisk}}. To use # in |text=, use |text={{number sign}}.
ดูเพิ่ม
- Variant blocks
- {{legend striped}}, two colors, for striped color areas
- {{legend inline}}, uses display:inline to avoid line breaks after each legend
- {{legend0}}, without the line-feed
- {{leftlegend}}, with text-align set to left
- {{color box}} and {{RouteBox}}, with text placed inside the colored legend and article linking
- {{legend-line}}, legends for lines
- {{image key}}, allows legend templates being used in image captions to use multiple columns
Templates that list colors
- {{Colornames}}
- {{X11 color chart}}
- {{Web Colors}}
TemplateData
ด้านล่างนี้คือข้อมูลแม่แบบ เอกสารกำกับสำหรับแม่แบบนี้ซึ่งใช้งานโดยตัวช่วยสร้างแม่แบบ เครื่องมือแก้ไขแบบเห็นภาพ และเครื่องมืออื่น ดูรายงานการใช้พารามิเตอร์ประจำเดือนสำหรับแม่แบบ:Legend
ข้อมูลแม่แบบสำหรับ Legend
Shows a legend row with a colored box and a caption.
| พารามิเตอร์ | คำอธิบาย | ชนิด | สถานะ | |
|---|---|---|---|---|
| Color | 1 | The color for the legend entry, in any CSS format
| บรรทัด | จำเป็น |
| Caption | 2 | Label for the legend entry
| สตริง | แนะนำ |
| CSS border style | border | CSS style for the legend entry's border | สตริง | ไม่บังคับ |
| Entry outline | outline | CSS color for the outline of the legend entry
| บรรทัด | ไม่บังคับ |
| Text in the entry | text | Text to be displayed in the legend entry box, i.e. within the color specified
| บรรทัด | ไม่บังคับ |
| Text color | textcolor | CSS color of text inside the legend's colored box | สตริง | ไม่บังคับ |
| Size | size | Font size of the legend entry, including colored box | สตริง | ไม่บังคับ |
