agcb trying to understand flexbox
A useful analogy for me has been a wooden box w/ a string tied across from one end to the other. Beads are hanging from the string like shoelaces on Electric Wires. The Box is the Parent. The String is the Main Axis and the beads on the string represent the children. The Parent Container and It's Children. It's children that live on a string.
This, with CSSGrid and the Box Module are the current and near-future.
Starting on the next line i will lay out all possible declarations... #First the Parent Containers.
- display: flex; /* or 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;
- align-items: flex-start | flex-end | center | baseline | stretch;
- flex-flow: row wrap;
- order: ;
- flex-grow: ; /* default 0 */
- flex-shrink: ; /* default 1 */
- flex-basis: | auto; /* default auto */
- align-self: auto | flex-start | flex-end | center | baseline | stretch;
- flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]
- One for the Children, and One for the Parent.
- Flex direction and flex wrap can be combined with the shorthand property FLEX-FLOW
- Grow, Shrink, and Basis can be done as simply....FLEX:
Many thanks to thomaspark, Chris, and estelle for making things a bit more clear.
I have also found this CheatSheet online.
flexbox docs can be found at W3C