Flexible Box Module (Flexbox) is a new way to create complicated layout of a web page or a part of a web page. Flexbox provides a more efficient way to lay out, align and distribute space among items in a container
Flexbox has two parts. One is parent which is a container having css property display:flex or display:inline-flex and second part is its direct children called flex items.
Parent (Flexbox) CSS properties:
.container {
display: flex | inline-flex;
flex-direction: row | row-reverse | column | column-reverse;
flex-wrap: nowrap | wrap | wrap-reverse;
flex-flow: <‘flex-direction’> || <‘flex-wrap’>
justify-content: flex-start | flex-end | center | space-between | space-around | space-evenly;
align-items: flex-start | flex-end | center | baseline | stretch;
align-content: flex-start | flex-end | center | space-between | space-around | stretch;
}
Childrens (Flexbox Items) CSS properties:
.container .item {
order: <integer>; /* default is 0 */
flex-grow: <number>; /* default 0 */
flex-shrink: <number>; /* default 1 */
flex-basis: <length> | auto; /* default auto */
flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]
align-self: auto | flex-start | flex-end | center | baseline | stretch;
align-content: flex-start | flex-end | center | space-between | space-around | stretch;
}
Note that float, clear and vertical-align have no effect on a flex item.