Sources
S1 — MDN: Basic concepts of flexbox
URL: https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Flexible_box_layout/Basic_concepts
- authority: official-docs
- supports: Lessons 01-03 — what
display: flexdoes, direct children becoming flex items, the main axis and cross axis, and thatjustify-contentaligns on the main axis whilealign-itemsaligns on the cross axis. - key-fact: "To create a flex container, set the area's
displayproperty toflex. When we do this, the direct children of that container become flex items." "The main axis is defined byflex-direction." "The cross axis runs perpendicular to the main axis." "Thejustify-contentproperty is used to align the items on the main axis." "Thealign-itemsproperty aligns all the flex items on the cross axis."
S2 — MDN: Aligning items in a flex container
URL: https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Flexible_box_layout/Aligning_items
- authority: official-docs
- supports: Lesson 02 — centering an item on both axes by combining
justify-content: center(main axis) andalign-items: center(cross axis). - key-fact: "To center an element, we use the
align-itemsproperty to align the item on the cross axis... We usejustify-contentto align the item on the main axis, which in this case is the inline axis running horizontally."
S3 — MDN: flex-direction
URL: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/flex-direction
- authority: official-docs
- supports: Lesson 03 —
flex-directionsets the main axis and the direction items flow; its default isrow;columnmakes the main axis vertical. - key-fact: "The
flex-directionCSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed)." Initial value:row.
S4 — MDN: Controlling ratios of flex items along the main axis
- authority: official-docs
- supports: Lesson 04 —
flex-basissets the starting size before free space is distributed;flex-grow/flex-shrinkdivide positive/negative free space by their factors;flex: 1usesflex-basis: 0to make equal items. - key-fact: "The
flex-basisproperty specifies the initial size of a flex item before any distribution of the positive or negative free space happens." "Theflex-growproperty specifies the flex grow factor, which determines how much a flex item will grow relative to the other flex items... when positive free space is distributed." "To create three equally-sized items... set theflex-basiscomponent to0."
S5 — MDN: Mastering wrapping of flex items
URL: https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Flexible_box_layout/Wrapping_items
- authority: official-docs
- supports: Lesson 05 — default
flex-wrap: nowrapoverflows;flex-wrap: wrapbreaks items onto new lines; thegapproperty spaces flex items and is shorthand forrow-gap/column-gap. - key-fact: "The initial value of the
flex-wrapproperty isnowrap. This means if a set of flex items is too wide for their flex container, they will overflow it." "add theflex-wrapproperty with a value ofwrap... Items will then wrap onto new lines when they overflow their container." "use thegapproperty directly on the flex container to create a fixed space between adjacent flex items. Thegapproperty is a shorthand forrow-gapandcolumn-gap."
S6 — CSS-Tricks: A Complete Guide to Flexbox
URL: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
- authority: authoritative-guide
- supports: Lessons 01, 04, 05 — the main-axis/cross-axis mental model, that only direct children are laid out by the container, the recommendation to use the
flexshorthand, and thatgapspaces items only between them, not on outer edges. - key-fact: "The main axis of a flex container is the primary axis along which flex items are laid out" while "the axis perpendicular to the main axis is called the cross axis." "This is the shorthand for flex-grow, flex-shrink and flex-basis combined... It is recommended that you use this shorthand." The
gapproperty "applies that spacing only between items not on the outer edges."
S7 — W3C: CSS Flexible Box Layout Module Level 1
URL: https://www.w3.org/TR/css-flexbox-1/
- authority: official-docs
- supports: Lessons 01-02 — the formal specification definitions of the main axis, the cross axis, and how flex items are placed along the main axis.
- key-fact: "The main axis of a flex container is the primary axis along which flex items are laid out." "The axis perpendicular to the main axis is called the cross axis." "The flex items are placed within the container starting on the main-start side and going toward the main-end side."