


Therefore, the CSS flex container defines the size, alignment, and position for its children. Then, all children of the container become flex items. The CSS flex container is the element that has a display property set to either flex or inline-flex. Note: understanding the axes of CSS flexbox is essential as CSS align and justifies flex items along them. If the main axis has a row or row-reverse direction, the cross axis runs along a column or column-reverse direction (and vice versa). Cross axis always goes perpendicular ( ⟂ ) to the main axis.column and column-reserve move from the top to bottom. Note: when set to row or row-reverse, the main axis moves along the row inline. It has four possible values: row, row-reverse, column, and column-reverse. You define the main axis with the flex-direction property.The CSS flexbox has two axes: the main and the cross. The items' ability to grow or shrink when the window resizes.The Justification of items and space in between.The wrapping of items when the window is resized.The direction to which the items are displayed.The CSS flexbox can control the following aspects of the layout: These properties allow organizing items inside the container (some apply to parent elements others apply to the children). Therefore, it does not lay out items on both vertical and horizontal dimensions simultaneously.Īssigning properties to the parent element is more productive than assigning them to each child element individually. Remember: the CSS flexbox is one-dimensional.
