.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;
}
(1) flex-start Default value, affixed to the starting point of the spindle. (2) flex-end Stick to the end of the spindle. (3) center Centered along the principal axis. (4) space-between Stick to both ends of the principal axis, with the first child element at the beginning of the principal axis and the last child element at the end of the principal axis. (5) space-around Evenly distributed among subelements along the principal axis.
it should be noted that the gap between the child elements appears to be uneven. The first and last child elements have a gap of one unit from the edge of the parent element, but there is a gap of two units between the two child elements, because there is a gap of one unit on both sides of each child element.
- Align-items Defines the alignment direction of child elements in the direction of the cross axis
.container {
align-items: flex-start | flex-end | center | baseline | stretch;
}
milar to justify-content is property does not work when there is only one row.
.container {
align-content: flex-start | flex-end | center | space-between | space-around |
stretch;
}
.item {
order: 0;
}
the default value is 0, and child elements will not be zoomed in even if there is space left.
.item {
flex-grow: 1;
}
u can override the alignment set by align-items in the parent element
.item {
align-self: auto | flex-start | flex-end | center | baseline | stretch;
}
float,clear and vertical-align are not valid for flex child elements.
- Flex-basis If the content of the flex container child element is empty, the placeholder space is set.