Changes

Jump to navigation Jump to search
2,890 bytes added ,  14:45, 5 November 2013
simplified a bit
{{Documentation subpage}}

===Usage===
{{tl|Flatlist}} starts a horizontal list, such as:
{{flatlist}}
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
{{endflatlist}}
The bottom margin is inherited from the current container. Normally this will be 0.5em. This template can be used with or without {{tl|endflatlist}}.

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

===Examples===
<pre><nowiki>
{{flatlist|
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
}}
</nowiki></pre>

{{flatlist|
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
}}

;Alternative syntax:
<pre><nowiki>
{{flatlist}}
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
{{endflatlist}}
</nowiki></pre>

{{flatlist}}
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
{{endflatlist}}

;Syntax for ordered lists:
<pre><nowiki>
{{flatlist|
# [[first]]
# [[second]]
# [[third]]
# [[fourth]]
# [[fifth]]
# [[sixth]]
}}
</nowiki></pre>

{{flatlist|
# [[first]]
# [[second]]
# [[third]]
# [[fourth]]
# [[fifth]]
# [[sixth]]
}}

===Parameters===
* '''class''' – adds a CSS class to the containing div. Passing <tt>hwrap</tt> allows list items to be wrapped.
* '''style''' – adds CSS style options. Complex styles should not be used in articles (per [[wp:deviations]]) but may be acceptable on user, project, and talk pages.
::Example: {{para|<var>style</var>|<var>border:solid 1px silver; background:lightyellow</var>}}
* '''indent''' – indents the list by a number of standard indents (one indent being 1.6em), particularly handy for inclusion in an indented discussion thread.
::Example: {{para|<var>indent</var>|<var>2</var>}}

===Technical details===
This template uses the <code>.hlist</code> CSS class defined in Common.css to generate horizontal lists. It causes ordinary html list items to be displayed 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.

====Bugs====
There is one situation where the <code>.hlist</code> class will fail in one or more 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.

===See also===
* {{tl|endflatlist}}
* {{tl|plainlist}}
* {{tl|nowrap begin}}/{{tl|nowrap end}}
* {{tl|pagelist}}

Navigation menu