It also exerts some control over the alignment of items when they overflow the line.
This defines the ability for a flex item to grow if necessary.
It accepts a unitless value that serves as a proportion.
If regular layout is based on both block and inline flow directions, the flex layout is based on "flex-flow directions".
Please have a look at this figure from the specification, explaining the main idea behind the flex layout.
Basically, items will be laid out following either the This establishes the main-axis, thus defining the direction flex items are placed in the flex container.
Flexbox is (aside from optional wrapping) a single-direction layout concept.
Think of flex items as primarily laying out either in horizontal rows or vertical columns.
By default, flex items will all try to fit onto one line.You can change that and allow the items to wrap as needed with this property.Direction also plays a role here, determining the direction new lines are stacked in. It helps distribute extra free space left over when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size.(Flexible Box) module (currently a W3C Last Call Working Draft) aims at providing a more efficient way to lay out, align and distribute space among items in a container, even when their size is unknown and/or dynamic (thus the word "flex").The main idea behind the flex layout is to give the container the ability to alter its items' width/height (and order) to best fill the available space (mostly to accommodate to all kind of display devices and screen sizes).A flex container expands items to fill available free space, or shrinks them to prevent overflow.