|
|
Line 1: |
Line 1: |
| {{Documentation subpage}}
| | {{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude> |
| <!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE -->
| | {{documentation}} |
| {{#ifeq:{{FULLPAGENAME}} | Template:Plainlist | {{high-use|100,000+}} }}
| | <!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> |
| | | </noinclude> |
| This template provides a [[Web Content Accessibility Guidelines|WCAG]]/ISO-standards-compliant accessible alternative to <code><nowiki><br /></nowiki></code> separated lists, per [[WP:UBLIST]] and [[WP:PLIST]]
| |
| | |
| ==Usage==
| |
| {{tl|plainlist}} starts a plain (i.e. unbulleted) list, such as: | |
| | |
| {{plainlist| | |
| * [[cat]]
| |
| * [[dog]]
| |
| * [[horse]]
| |
| * [[cow]]
| |
| * [[sheep]]
| |
| * [[pig]]
| |
| }}
| |
| | |
| It uses proper HTML list markup, which is more standards-compliant and more accessible than separating list items with {{tag|br|s}}. Detailed reasons for using this template can be found at [[WP:UBLIST]].
| |
| | |
| This template can be used with or without {{tl|endplainlist}}. It is an alternative to {{tl|unbulleted list}}, which performs the same function in a more concise but less wiki-style manner. Note that {{tl|unbulleted list}} will work inside image captions, whereas {{tl|plainlist}} does not.
| |
| | |
| ==Examples==
| |
| {{Markup
| |
| |<nowiki>
| |
| {{plainlist|
| |
| * [[cat]]
| |
| * [[dog]]
| |
| * [[horse]]
| |
| * [[cow]]
| |
| * [[sheep]]
| |
| * [[pig]]
| |
| }}
| |
| </nowiki>
| |
| |
| |
| {{plainlist|
| |
| * [[cat]]
| |
| * [[dog]]
| |
| * [[horse]]
| |
| * [[cow]]
| |
| * [[sheep]]
| |
| * [[pig]]
| |
| }}
| |
| }}
| |
| === Alternative syntax ===
| |
| {{Markup
| |
| |<nowiki>
| |
| {{plainlist}}
| |
| * [[cat]]
| |
| * [[dog]]
| |
| * [[horse]]
| |
| * [[cow]]
| |
| * [[sheep]]
| |
| * [[pig]]
| |
| {{endplainlist}}
| |
| </nowiki>
| |
| |
| |
| {{plainlist}}
| |
| * [[cat]]
| |
| * [[dog]]
| |
| * [[horse]]
| |
| * [[cow]]
| |
| * [[sheep]]
| |
| * [[pig]]
| |
| {{endplainlist}}
| |
| }}
| |
| | |
| ===Optional parameters===
| |
| * '''class''' – adds a CSS class to the containing div.
| |
| * '''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>}}
| |
| | |
| === Controlling line-breaking ===
| |
| Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists, to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
| |
| | |
| ==Technical details==
| |
| {{tl|Plainlist}} works by constructing a div with the CSS class "plainlist" which has the following style:
| |
| <source lang="css">
| |
| .plainlist ul {
| |
| line-height: inherit;
| |
| list-style: none none;
| |
| margin: 0;
| |
| }
| |
| .plainlist ul li {
| |
| margin-bottom: 0;
| |
| }
| |
| </source> | |
| | |
| ==Redirects==
| |
| * {{tl|Startplainlist}}
| |
| | |
| ==See also==
| |
| * {{tl|unbulleted list}}
| |
| * {{tl|flatlist}} and {{tl|hlist}} (Replacements for comma- or dash-separated lists)
| |
| * {{tl|ordered list}} and {{tl|unordered list}}
| |
| | |
| <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
| |
| <!-- CATEGORIES HERE, THANKS --> | |
| [[Category:List formatting and function templates|Plainlist]]
| |
| [[Category:Semantic markup templates]]
| |
| [[Category:Typing-aid templates|Plainlist]]
| |
| }}</includeonly>
| |
{{[[Template:{{{1}}}|{{{1}}}]]}}
Template documentation (for the above template, sometimes hidden or invisible)