แม่แบบ:Legend

จากวิกิพีเดีย สารานุกรมเสรี
Documentation icon คู่มือการใช้งานแม่แบบ[ดู] [แก้] [ประวัติ] [ล้างแคช]

แสดงคำอธิบายสัญลักษณ์ด้วยกล่องสี

การใช้งาน

{{legend|สีพื้นหลัง|คำอธิบาย|outline=outline color|border=css border}}
  • สีพื้นหลัง สามารถใช้รหัสสี HTML หรือใช้ชื่อสีในภาษาอังกฤษก็ได้ ตามตัวอย่างข้างล่าง มันสามารถใส่ภาพไปได้ด้วย
  • border หรือ พารามิเตอร์กรอบ ขึ้นอยู่กับคุณว่าจะใส่หรือไม่

ตัวอย่าง

ใช้ในข้อความปกติ

{{legend|black|แอฟริกา}}
{{legend|green|อเมริกา}}
{{legend|blue|โอเชียเนีย}}
{{legend|#ffa|ยุโรป|outline=silver}}
{{legend|#ff2800|เอเชีย|outline=#A2A9B1}}
  แอฟริกา
  อเมริกา
  โอเชียเนีย
  ยุโรป
  เอเชีย

ใช้ในคำอธิบายภาพ

มาร์กอัป แสดงผลเป็น
 [[File:Celts in Europe.png|upright=.9|thumb|right|The Celts in Europe, past and present:
 {{legend|#1a8000|Present-day Celtic-speaking areas}}
 {{legend|#27c600|Other parts of the six most commonly recognized "Celtic nations" and where a Celtic language is spoken but not the dominating language}}
 {{legend|#97ffb6|Other parts of Europe once peopled by Celts; modern-day inhabitants of many of these areas often claim a Celtic heritage and/or culture}}
 {{legend|#D2FFD2|Lusitanian area of Iberia, "Celticity" uncertain}}
 {{legend|yellow|The core Hallstatt territory, expansion before 500 BC}}
 ]]
The Celts in Europe, past and present:
  Present-day Celtic-speaking areas
  Other parts of the six most commonly recognized "Celtic nations" and where a Celtic language is spoken but not the dominating language
  Other parts of Europe once peopled by Celts; modern-day inhabitants of many of these areas often claim a Celtic heritage and/or culture
  Lusitanian area of Iberia, "Celticity" uncertain
  The core Hallstatt territory, expansion before 500 BC

รายการพารามิเตอร์ทั้งหมด

{{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

TemplateData

ด้านล่างนี้คือข้อมูลแม่แบบ เอกสารกำกับสำหรับแม่แบบนี้ซึ่งถูกใช้งานโดยเครื่องมือแก้ไขแบบเห็นภาพและเครื่องมืออื่น ๆ

ข้อมูลแม่แบบสำหรับ Legend (ยังไม่มีการตรวจสอบ)

Shows a legend row with a colored box and a caption.

พารามิเตอร์แม่แบบ[แก้ไขข้อมูลแม่แบบ]

พารามิเตอร์คำอธิบายชนิดสถานะ
Color1

The color for the legend entry, in any CSS format

ตัวอย่าง
"#6D6E00", "#ffa", "yellow"
บรรทัดจำเป็น
Caption2

Label for the legend entry

ตัวอย่าง
"soda" is most common
สตริงแนะนำ
CSS border styleborder

CSS style for the legend entry's border

สตริงเลือกได้
Entry outlineoutline

CSS color for the outline of the legend entry

ตัวอย่าง
silver
บรรทัดเลือกได้
Text in the entrytext

Text to be displayed in the legend entry box, i.e. within the color specified

ตัวอย่าง
Af
บรรทัดเลือกได้
Text colortextcolor

CSS color of text inside the legend's colored box

สตริงเลือกได้
Sizesize

Font size of the legend entry, including colored box

สตริงเลือกได้