CSS Flex Box
Simple example
.container {
display: flex;
}.container > div {
flex: 1 1 auto;
}Container
.container { display: flex;
display: inline-flex; flex-direction: row; /* ltr - default */
flex-direction: row-reverse; /* rtl */
flex-direction: column; /* top-bottom */
flex-direction: column-reverse; /* bottom-top */ flex-wrap: nowrap; /* one-line */
flex-wrap: wrap; /* multi-line */ align-items: flex-start; /* vertical-align to top */
align-items: flex-end; /* vertical-align to bottom */
align-items: center; /* vertical-align to center */
align-items: stretch; /* same height on all (default) */Child
Tricks
Vertical center
Vertical center (2)
Reordering
Mobile layout
Table-like
Vertical
Left and right
References
Last updated