CSS Flex Box Layout is a CSS3 web layout model that allows elements within a container to be automatically arranged and resized depending on screen size. It defines flex containers and flex items, with properties that control alignment, order, sizing, and distribution of space. Common flex properties include flex-direction, flex-wrap, justify-content, align-items, and properties for individual flex items like order, flex-grow, and align-self. Flexbox provides more flexible layout options compared to traditional CSS box model properties.
2. INSTRUCTION
CSS Flex Box Layout is a CSS3 web layout model. It is in the W3C's Candidate
Recommendation (CR) stage. The flex layout allows responsive elements within a container,
automatically arranged to different size screens or devices.
CSS 2.1 defined four layout modes — algorithms which determine the size and position of boxes
based on their relationships with their sibling and ancestor boxes:
block layout, designed for laying out documents
inline layout, designed for laying out text
table layout, designed for laying out 2D data in a tabular format
positioned layout, designed for very explicit positioning without much regard for other elements
in the document
5. Flex Layout Box Model and Terminology
A flex container is the box generated by an element with a computed display of
flex or inline-flex. In-flow children of a flex container are called flex items and are
laid out using the flex layout model.
9. “Flex-flow
This is a shorthand flex-direction and flex-wrap properties,
which together define the flex container's main and cross
axes. Default is row nowrap.
flex-flow: <『flex-direction'> || <『flex-wrap'>
15. flex
This is the shorthand for flex-grow, flex-shrink and flex-basis
combined. The second and third parameters (flex-shrink and
flex-basis) are optional. Default is 0 1 auto.
.item {
flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]
}