توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

استفاده

{{Flatlist}} starts a horizontal list, such as:

The bottom margin is inherited from the current container. Normally this will be 0.5em. This template can be used with or without {{endflatlist}}.

For navigation boxes using {{navbox}}, one can set |listclass=hlist, and achieve the same styling without using this template.

نمونه‌ها

{{flatlist |
* [[گربه]]
* [[سگ]]
* [[اسب]]
* [[گاو]]
* [[گوسفند]]
* [[خوک]]
}}
Alternative syntax
{{flatlist}}
* [[گربه]]
* [[سگ]]
* [[اسب]]
* [[گاو]]
* [[گوسفند]]
* [[خوک]]
{{endflatlist}}
نشانه‌گذاری نمایش
{{Hlist|entry1|entry2|entry3|entry4|entry5|entry6|entry7|entry8|entry9}}
  • entry1
  • entry2
  • entry3
  • entry4
  • entry5
  • entry6
  • entry7
  • entry8
  • entry9
سیارات غول پیکر ({{Hlist|[[مشتری (سیاره)|J]]|[[زحل|S]]|[[اورانوس|U]]|[[نپتون|N]]}}).
سیارات غول پیکر ().
سیارات غول پیکر ({{Hlist|class=inline|[[مشتری (سیاره)|J]]|[[زحل|S]]|[[اورانوس|U]]|[[نپتون|N]]}}).
سیارات غول پیکر ().
{{Hlist|قهرمان|نائب قهرمان|مقام سوم|indent=2}}
  • قهرمان
  • نائب قهرمان
  • مقام سوم
{{Hlist|قهرمان|نائب قهرمان|مقام سوم|item_style=color:blue;}}
  • قهرمان
  • نائب قهرمان
  • مقام سوم
{{Hlist|قهرمان|نائب قهرمان|مقام سوم|item1_style=background-color:yellow;|item2_style=background-color:silver;}}
  • قهرمان
  • نائب قهرمان
  • مقام سوم

پارامترها

All parameters

{{hlist|first item|second item|third item|...}}
{{hlist

|first item|second item|third item|... |class = class for div tag |style = style for div tag |list_style = style for ul tag |item_style = style for all li tags |item1_style = style for first li tag |item2_style = style for second li tag |... |indent = the number of tabs to indent

}}


  • Positional parameters (1, 2, 3...): these are the list items. If no list items are present, the module will output nothing.
  • class: a custom class for the <div>...</div> tags surrounding the list. Set to inline when using {{hlist}} inside text.
  • style: a custom CSS style for the <div>...</div> tags surrounding the list, e.g. font-size: 90%;.
  • list_style: a custom CSS style for the <ul>...</ul> tags around the list. The format is the same as for the |style= parameter.
  • item_style: a custom CSS style for all of the list items (the <li>...</li> tags). The format is the same as for the |style= parameter.
  • item1_style, item2_style, item3_style...: custom CSS styles for each of the list items. The format is the same as for the |style= parameter.
  • indent: the number of tabs to indent the list. Default value is 0.

جزئیات فنی

This template uses the .hlist CSS class defined in Common.css to generate horizontal lists. It causes ordinary html list items to be dispayed inline (horizontally), where they would normally display as block elements (vertically). The class also generates the interpuncts between list items and parentheses around nested lists. Some of the CSS used is not compatible with all browsers, notably Internet Explorer 6 and 7. In these cases, JavaScript in Common.js generates the interpuncts and parentheses.

مشکلات

There are some situations where the .hlist class will fail in one or more browsers:

  1. Internet Explorer 8 and 9: If a horizontal list is embedded in a table (such as a navbox), and the list items start with an image, IE will fail to wrap the list to the next line, causing it to display beyond the page boundaries. This can be fixed by adding &nbsp; in front of the images.
  2. All browsers: When a horizontal list, built using wiki markup, is displayed on Special: pages (where it may be transcluded from MediaWiki: pages), horizontal lists will not wrap to the next line. This is due to HTML Tidy not being active on these pages. This may be fixed in the future (Bugzilla:39617). As a workaround, use HTML instead of wiki markup to build the lists.

الگوهای وابسته