Flex Container | ||||||||||||||||||||||
display | flex | inline-flex | |||||||||||||||||||||
Set display property to activate flexbox layout. Difference between flex and inline-flex is like between block and inline-block.
|
||||||||||||||||||||||
flex-direction | row | row-reverse | column | column-reverse | default: row | ||||||||||||||||||||
Defines how flex items belonging to a common flex container are placed by setting the main axis.
row is horizontal (left on the image), column is vertical (right).Add -reverse for ordering from last to first item. |
||||||||||||||||||||||
flex-wrap | nowrap | wrap | wrap-reverse | default: nowrap | ||||||||||||||||||||
Defines how flex items are wrapped into lines.
|
||||||||||||||||||||||
flex-flow | <'flex-direction'> || <'flex-wrap'> | default: see individual properties | ||||||||||||||||||||
A shorthand property to define <code>flex-direction</code> and <code>flex-wrap</code>.
flex-flow: row; flex-flow:column nowrap
|
||||||||||||||||||||||
justify-content | flex-start | flex-end | center | space-between | space-around | default: flex-start | ||||||||||||||||||||
Defines how flex items are laid out along the main axis on the current line.
|
||||||||||||||||||||||
align-items | flex-start | flex-end | center | baseline | stretch | default: stretch | ||||||||||||||||||||
Defines how flex items are aligned along the cross axis.
|
||||||||||||||||||||||
align-content | flex-start | flex-end | center | space-between | space-around | stretch | default: stretch | ||||||||||||||||||||
Defines how a flex container's lines are aligned along the cross axis (only for multi-line containers).
The ‘align-content’ property aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how ‘justify-content’ aligns individual items within the main-axis: |
||||||||||||||||||||||
Flex Item | ||||||||||||||||||||||
flex-grow | <number> | default: ‘0’ | ||||||||||||||||||||
Defines how much the flex item's size will increase in proportion to the other items in the flex container when free space is distributed.
|
||||||||||||||||||||||
flex-shrink | <number> | default: ‘1’ | ||||||||||||||||||||
Defines how much the flex item's size will decrease in proportion to the other items in the flex container.
|
||||||||||||||||||||||
flex-basis | <'width'> | default: auto | ||||||||||||||||||||
Determines the initial main size of a flex item.
|
||||||||||||||||||||||
flex | none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ] | default: see individual properties | ||||||||||||||||||||
A shorthand property for flex-grow, flex-shrink, and flex-basis that reflects the ability of a flex item to either stretch of shrink when needed.
|
||||||||||||||||||||||
order | <number> | default: 0 | ||||||||||||||||||||
Defines the order in which flex items appear in a flex layout.
A flex container will lay out its content starting from the lowest numbered ordinal group and going up. Items with the same ordinal group are laid out in the order they appear in the source document. |
||||||||||||||||||||||
align-self | auto | flex-start | flex-end | center | baseline | stretch | default: auto | ||||||||||||||||||||
Defines how an individual item is aligned on the cross axis, and overrides the default established by align-items.
auto means value of parent container |