• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Flatlist

  • Template
  • Talk
  • Language
  • Watch
  • Change
Template documentation[view] [edit] [history] [purge]

Contents

  • 1 Usage
  • 2 Examples
  • 3 Parameters
  • 4 Technical details
    • 4.1 Bugs
  • 5 Related pages

Usage

change

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

  • cat
  • dog
  • horse
  • cow
  • sheep
  • pig

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.

Examples

change
{{flatlist |
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
}}
  • cat
  • dog
  • horse
  • cow
  • sheep
  • pig
Alternative syntax
{{flatlist}}
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
{{endflatlist}}
  • cat
  • dog
  • horse
  • cow
  • sheep
  • pig


Syntax for ordered lists
{{flatlist | class=hnum |
# [[first]]
# [[second]]
# [[third]]
# [[fourth]]
# [[fifth]]
# [[sixth]]
}}
  1. first
  2. second
  3. third
  4. fourth
  5. fifth
  6. sixth

Parameters

change
  • class – adds a CSS class to the containing div. Passing hnum will cause ordered lists to have numbers.
  • 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: |style=border:solid 1px silver; background:lightyellow
  • 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: |indent=2

Technical details

change

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.

Bugs

change

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

Related pages

change
  • {{endflatlist}}
  • {{plainlist}}
  • {{multi-column numbered list}}
  • {{nowrap begin}}/{{nowrap end}}
  • {{pagelist}}
  • WP:HLIST
The documentation on top is transcluded from Template:Flatlist/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://simple.wikipedia.org/w/index.php?title=Template:Flatlist&oldid=9223355"
Last edited on 30 November 2023, at 12:47

Languages

    • Afrikaans
    • Anarâškielâ
    • अंगिका
    • Ænglisc
    • Аԥсшәа
    • العربية
    • Արեւմտահայերէն
    • Arpetan
    • অসমীয়া
    • Avañe'ẽ
    • Авар
    • Azərbaycanca
    • تۆرکجه
    • Basa Bali
    • বাংলা
    • 閩南語 / Bân-lâm-gú
    • Башҡортса
    • Беларуская
    • Беларуская (тарашкевіца)
    • भोजपुरी
    • Български
    • Bosanski
    • Буряад
    • Català
    • Чӑвашла
    • Cebuano
    • Čeština
    • Chi-Chewa
    • ChiTumbuka
    • Corsu
    • Cymraeg
    • Dansk
    • الدارجة
    • डोटेली
    • Eesti
    • Ελληνικά
    • English
    • Эрзянь
    • Español
    • Esperanto
    • Euskara
    • فارسی
    • Føroyskt
    • Français
    • Gaeilge
    • Gagauz
    • Galego
    • ГӀалгӀай
    • ગુજરાતી
    • Gungbe
    • 客家語 / Hak-kâ-ngî
    • 한국어
    • Hausa
    • Հայերեն
    • हिन्दी
    • Hrvatski
    • Igbo
    • Ilokano
    • Bahasa Indonesia
    • Íslenska
    • Italiano
    • עברית
    • Jawa
    • ქართული
    • Қазақша
    • Kurdî
    • Ladin
    • Ladino
    • Latviešu
    • Lietuvių
    • Magyar
    • Madhurâ
    • मैथिली
    • Македонски
    • മലയാളം
    • Malti
    • मराठी
    • مصرى
    • ဘာသာမန်
    • Bahasa Melayu
    • ꯃꯤꯇꯩ ꯂꯣꯟ
    • 閩東語 / Mìng-dĕ̤ng-ngṳ̄
    • Mirandés
    • Мокшень
    • Монгол
    • မြန်မာဘာသာ
    • Nederlands
    • Nedersaksies
    • नेपाली
    • 日本語
    • Нохчийн
    • Nordfriisk
    • Norsk bokmål
    • Occitan
    • ଓଡ଼ିଆ
    • Oʻzbekcha / ўзбекча
    • ਪੰਜਾਬੀ
    • Pangasinan
    • ပအိုဝ်ႏဘာႏသာႏ
    • Papiamentu
    • پښتو
    • ភាសាខ្មែរ
    • Polski
    • Português
    • Română
    • Русиньскый
    • Русский
    • संस्कृतम्
    • سرائیکی
    • Scots
    • Sesotho sa Leboa
    • Shqip
    • සිංහල
    • سنڌي
    • Slovenščina
    • Ślůnski
    • کوردی
    • Српски / srpski
    • Srpskohrvatski / српскохрватски
    • Sunda
    • Suomi
    • Svenska
    • Tagalog
    • தமிழ்
    • Taqbaylit
    • Татарча / tatarça
    • တႆး
    • తెలుగు
    • ไทย
    • Тоҷикӣ
    • ತುಳು
    • Türkçe
    • Türkmençe
    • Tyap
    • Українська
    • اردو
    • Vèneto
    • Tiếng Việt
    • 文言
    • Winaray
    • Wolof
    • 吴语
    • Yorùbá
    • 粵語
    • Zazaki
    • 中文
    • Jaku Iban
    • Kumoring
    • ꠍꠤꠟꠐꠤ
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last changed on 30 November 2023, at 12:47.
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop