Understanding CSS Flexbox
Flexbox is a modules in CSS3 that makes it easy to align elements to one another, in different directions and orders. The main idea behind flexbox is to give the container the ability to expand and to shrink elements to best use all the available space. Flexbox completely changes the way that we build one-dimensional layouts.
bold is a default value
Container
flex-direction
: row / row-reverse / column / column-reverseflex-wrap
: nowrap / wrap / wrap-reversejustify-content
: flex-start / flex-end / center / space-between / space-around / space-evenlyalign-items
: stretch / flex-start / flex-end / center / baselinealign-content
: stretch / flex-start / flex-end / center / space-between / space-around
Item
align-self
: auto / stretch / flex-start / flex-end / center / baselineorder
: 0 / <integer>flex-grow
: 0 / <integer>flex-shrink
: 1 / <integer>flex-basis
: auto / <length>
Shorten hand flex
flex
is a shortened property of flex-grow
, flex-shrink
, and flex-basis
Originally published at https://jiajiewu1988.github.io.