Modifications

Aller à : navigation, rechercher

Modèle:Flex columns/doc

1 758 octets ajoutés, 25 février 2019 à 23:04
Page créée avec « {{Documentation subpage}} {{high-use| 2842 }} {{Uses Lua|Module:Flex columns}} {{Uses TemplateStyles|Template:Flex columns/styles.css}} <!-- Please place categories where... »
{{Documentation subpage}}
{{high-use| 2842 }}
{{Uses Lua|Module:Flex columns}}
{{Uses TemplateStyles|Template:Flex columns/styles.css}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
This template creates a column layout, where contents within the columns will have the same height, with any extra whitespace distributed throughout the shorter columns contents. It is mainly intended for use in portals.

This sort of layout requires browsers to support [[CSS flex-box layout|CSS flexbox]]. For those that don't there is a fallback that will show a two column view, but without the heights being the same (a layout many portals used as at July 2018).

For narrow screens, e.g. mobile devices, the display reverts to a single column.
== Usage ==
<pre>{{Flex columns
|1 = (...first column contents...)
|2 = (...second column contents...)
}}</pre>
Only contents which are in {{tag|div}} tags will have extra whitespace distributed to them – except for those with class <code>flex-columns-noflex</code> (or otherwise override the <code>flex:</code> property)

To change the column balance, {{para|flex1}} and/or {{para|flex2}} can be set. The default for each is <code>1</code>. For example:
*<code><nowiki>|flex1=3 |flex2=2</nowiki></code> will result in the first column taking up to 60% (3/5) of the available width, and the second column taking up at least 40% (2/5) of the width.
Note that the actual column balance will vary depending on screen size, since the minimum width of each column is set at 360px.

== See also ==
{{Portal templates navbox}}

<includeonly>{{sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->


}}</includeonly>
176
modifications

Menu de navigation