The CSS Flexible Box Layout Module simplifies the creation of flexible responsive layout structures without the use of floats or positioning. When we say flexbox is one-dimensional, we are referring to the fact that it only works with one dimension at a time — either a row or a column.
Property | Values |
---|---|
display | flex | inline-flex |
flex-direction | row | row-reverse | column | column-reverse |
flex-wrap | nowrap | wrap | wrap-reverse |
justify-content | flex-start | flex-end | center | space-between | space-around | space-evenly |
align-items | flex-start | flex-end | center | stretch | baseline |
align-content | flex-start | flex-end | center | stretch | space-between | space-around |
align-self | auto | flex-start | flex-end | center | baseline | stretch |
flex-grow | value - default 0 |
flex-shrink | value - default 1 |
order | value - default 1 |
.container {
display: flex | inline-flex;
}
.container {
flex-direction: row | row-reverse | column | column-reverse;
}
.container {
flex-wrap: nowrap | wrap | wrap-reverse;
}
.container {
justify-content: flex-start | flex-end | center | space-between | space-around | space-evenly;
}
.container {
align-content:flex-start | flex-end | center | stretch | space-between | space-around;
}
.container {
align-items: flex-start | flex-end | center | stretch | baseline;
}
.item {
align-self: auto | flex-start | flex-end | center | baseline | stretch;
}
.item {
flex-grow: 2; /* default 0 */
}
.item {
flex-shrink: 4; /* default 1 */
}
.item {
order:2; /* default 1 */
}