Template:Flexbox/doc

A set of templates for flexbox layout. they can be used to replace table layout in certain situations for better responsive layout. It is more flexible and has better readability, especially on small width screen, such as smartphone.

Usage
The simplest usage is to use the contents as parameter:

but, the presence of certain characters in the parameters may output unintented results, Therefore, using flexstart and flexend to do so is recommended:

If needed, you can explicitly define flexitem and take control on them:

Flexbox can be nested, a flexitem can also be a flexbox, In this way, a very complex layout can be achieved:

Parameters
Almost all parameters about flexbox and flexitem are mapped to the corresponding CSS properties. So all valid values for that CSS property can be used as value of the parameter.

flexstart has the following parameters available：
 * Type declaration:
 * unnamed parameter 1: Can be,  ,  ,  , correspond to flexbox, inline-flexbox, flexitem, respectively.   is alias of  .Default value is.
 * General parameters:
 * cssclass: Css class(es), class attribute for html element. When presented, will be used for.
 * id: Id attribute for html element. When presented, will be used for.
 * width: Css width value. It actually set css  porperty.
 * height: Css height value. It actually set css  porperty.
 * css or style: Custom css rules. When both presented, css will take precedence over style. Custom css rules will overide css rules from other parameters.
 * Parameters for flexbox:
 * wrap: Controls whether the flexbox is single-line or multi-line. It actually set css  porperty. Can be   /   or any valid value for css   property.   is alias of css value , and   is alias of  . Default value is.
 * direction: specifies how flex items are placed in the flexbox, by setting the direction of the flexbox's main axis. This determines the direction in which flex items are laid out in. Values can be  (default),,  ,.
 * justify: How content items will justified inline. It actually set css  porperty. Can be   /   /   /   or other valid value for css   property.   is alias of css value ,   is alias of  , and   is alias of  . Default value is.
 * alignitems: How content items will vertical aligned in current line of flexbox. It actually set css  porperty. Can be   /   /   or other valid value for css   property.   is alias of css value ,   is alias of  , and   is alias of  . Default value is.
 * alignlines: Aligns a flexbox's lines within the flexbox when there is extra space in the cross-axis, similar to how   aligns individual items within the main axis. Note that this has no effect when the flexbox has only a single line.   is alias of css value ,   is alias of  , and   is alias of  . Default value is.
 * parameters for flexitem:
 * order: CSS order property. example:
 * grow: CSS flex-grow property. example:
 * shrink: CSS flex-shrink property.
 * basis: CSS flex-basis property.
 *  alignself: CSS align-self property. Used to control the way this item is aligned on cross axis(Typically vertical), override the alignitems of flexbox. You can use / /  as its value,   is alias of css value ,   is alias of  , and   is alias of  . Default value is.

General parameters and Parameters for flexbox are also available on flexbox, General parameters and Parameters for flexitem are also available on flexitem.

flexend have no defined parameter.

Dummy parameter
You can use dummy parameter to help locate pairs:

Basic
or

You will get: (Please resize your broswer window to see how it responds to the change of width. )

Inline Flexbox
You can use inline or inlinebox as the value of unnamed parameter 1 to make the flexbox became inline.

Example: xx yy zz

It will output:

xx yy zz

Contents Alignment
You can use alignitems parameter to change the way of contents alignment in crossing axis.

Example:

You will get:

Justify Contents
You can use justify parameter to control how the contents will align along the current line in flexbox.

Example:

You will get:

Take control on Flexitem
If you need control the css style of flex item inside, you can simply apple css on it(or on a wrap html element), like:

But use flexstart and flexend and/or flexitem can get the best browser compatibility, also more convenient.

Their usage is very similar to flexbox:

example:

or

You will get: