Glossary

70 terms from "CSS Flexbox: axes, alignment, and flexible sizing." Look them up when you get stuck; the first mention in the text carries a hover definition.

TermDefinitionSource
flex containerAn element with display: flex, whose direct children are laid out as flex items along an axis.MDN: Basic concepts of flexbox
flex itemA direct child of a flex container; only direct children (not deeper descendants) become flex items.MDN: Basic concepts of flexbox
display: flexThe declaration set on a container that turns its direct children into flex items and lays them out along the main axis.MDN: Basic concepts of flexbox
direct childrenThe elements exactly one level inside the container — the only elements display: flex turns into flex items.CSS-Tricks: A Complete Guide to Flexbox
nested flex containerAn element that is a flex item of its parent and, because it also has display: flex, a flex container for its own children.CSS-Tricks: A Complete Guide to Flexbox
display: inline-flexA value that makes a flex container which sits inline in the surrounding text, while its children behave exactly as in a display: flex container.MDN: Basic concepts of flexbox
block layoutThe default layout mode where each element takes its own line and boxes stack vertically — what display: flex replaces.MDN: Basic concepts of flexbox
flex lineThe single line along the main axis that a flex container places its items on, unless wrapping is enabled.MDN: Basic concepts of flexbox
main axisThe primary axis a flex container lays its items out along; its direction is set by flex-direction (horizontal by default).W3C: CSS Flexible Box Layout Module Level 1
start edgeThe side of the main axis items are placed from — the default position, since items do not begin centered.MDN: Basic concepts of flexbox
initial valuesThe bundle of defaults display: flex switches on at once — row direction, no growing, shrinking allowed, cross-axis stretching, auto basis, and no wrapping.MDN: Basic concepts of flexbox
one-dimensional layoutFlexbox's model: it arranges items along one axis at a time, a row or a column, rather than rows and columns together.MDN: Basic concepts of flexbox
CSS GridThe sibling layout module that controls rows and columns together, and the right tool once a layout is genuinely two-dimensional.MDN: Basic concepts of flexbox
cross axisThe axis perpendicular to the main axis of a flex container.W3C: CSS Flexible Box Layout Module Level 1
justify-contentThe property that aligns flex items along the main axis (for example center, flex-start, flex-end, space-between).MDN: Basic concepts of flexbox
align-itemsThe property that aligns flex items along the cross axis (for example center, flex-start, flex-end, stretch).MDN: Basic concepts of flexbox
justify-content: centerCentering along the main axis; one half of centering a box in both directions.MDN: Aligning items in a flex container
align-items: centerCentering along the cross axis; the second property needed to center a box in both directions.MDN: Aligning items in a flex container
flex-startAn alignment value naming the start end of the relevant axis — main-start for justify-content, cross-start for align-items.MDN: Aligning items in a flex container
flex-endAn alignment value naming the end of the relevant axis — main-end for justify-content, cross-end for align-items.MDN: Aligning items in a flex container
space-betweenA main-axis distribution that shares all spare space evenly between the items, leaving the first and last flush against the two ends.MDN: Aligning items in a flex container
space-aroundA distribution where each item gets a half-size space on either end, so the outer edges get half the gap the interiors do.MDN: Aligning items in a flex container
space-evenlyA distribution where every space, including the two outer ones, is full-size.MDN: Aligning items in a flex container
stretchThe initial value of align-items: items fill the cross axis, which is why sibling cards end up the same height.MDN: Aligning items in a flex container
baselineA cross-axis alignment value that lines items up by the baseline of their text rather than by their box edges.MDN: Aligning items in a flex container
align-selfAn item-level property that overrides the container's align-items for one item; accepts the same values plus auto.MDN: Aligning items in a flex container
justify-itemsA property that is ignored in flex layouts, because flex treats items as one group on the main axis.MDN: Basic concepts of flexbox
auto marginThe main-axis escape hatch: margin-left: auto consumes all the free space it can, pushing one item away from the group.MDN: Aligning items in a flex container
flex-directionThe property that sets which way the main axis points and the direction items flow (row by default, or column, row-reverse, column-reverse).MDN: flex-direction
flex-direction: rowThe default value: the main axis runs along the row, so items flow horizontally in a left-to-right document.MDN: flex-direction
flex-direction: columnThe value that points the main axis top to bottom, so items stack and justify-content becomes the vertical property.MDN: Basic concepts of flexbox
row-reverseA value that keeps the horizontal axis but swaps which end is main-start, so items lay out from the opposite end.MDN: flex-direction
column-reverseA value that keeps the vertical axis but starts items from the bottom.MDN: flex-direction
main-startThe end of the main axis items are placed from; what flex-start resolves to for justify-content.W3C: CSS Flexible Box Layout Module Level 1
main-endThe far end of the main axis; what flex-end resolves to for justify-content.W3C: CSS Flexible Box Layout Module Level 1
writing modeThe document's text direction, which Flexbox makes no assumption about — it resolves start and end against it.MDN: Basic concepts of flexbox
directionalityThe flex container's left-to-right or right-to-left setting, which flips what row and row-reverse mean.MDN: flex-direction
block directionThe direction blocks stack in — the way flex-direction: column points the main axis.MDN: Basic concepts of flexbox
visual orderThe order items appear on screen, which the -reverse values change without touching the markup.MDN: flex-direction
DOM orderThe order elements appear in the markup — the sequence assistive technology follows regardless of CSS reordering.MDN: flex-direction
assistive technologyTools such as screen readers whose users receive content in DOM order, which is why -reverse values carry an accessibility cost.MDN: flex-direction
flex-flowThe shorthand that combines flex-direction and flex-wrap, so flex-flow: row wrap sets both at once.MDN: Basic concepts of flexbox
flex-basisA flex item's starting size along the main axis before any free space is distributed.MDN: Controlling ratios of flex items along the main axis
flex-basis: autoThe default basis: the item's starting size comes from its own width, or from its content when no width is set.MDN: Controlling ratios of flex items along the main axis
flex-growA factor that determines how much of the positive free space a flex item takes relative to its siblings.MDN: Controlling ratios of flex items along the main axis
flex-shrinkA factor that determines how much a flex item shrinks relative to its siblings when there is negative free space.MDN: Controlling ratios of flex items along the main axis
flex shorthandThe flex property that sets flex-grow, flex-shrink, and flex-basis together; flex: 1 expands to 1 1 0.CSS-Tricks: A Complete Guide to Flexbox
flex: 1 1 0What flex: 1 expands to — grow 1, shrink 1, basis 0 — which is why several flex: 1 items come out equal regardless of content.MDN: Basic concepts of flexbox
free spaceWhat is left in the container after every item's base size is reserved; the only thing grow and shrink ever divide.MDN: Controlling ratios of flex items along the main axis
positive free spaceThe condition where the container is bigger than needed to display its items — the only case flex-grow acts on.MDN: Controlling ratios of flex items along the main axis
negative free spaceThe condition where the items' combined natural size exceeds the container — the only case flex-shrink acts on.MDN: Controlling ratios of flex items along the main axis
grow factorThe unitless number flex-grow contributes to the sum that divides positive free space; only its ratio to siblings matters.MDN: Controlling ratios of flex items along the main axis
shrink factorThe number flex-shrink contributes, multiplied by the item's flex base size before negative space is distributed.MDN: Controlling ratios of flex items along the main axis
flex base sizeThe item's resolved starting size, which the shrink factor is multiplied by when negative space is distributed.MDN: Controlling ratios of flex items along the main axis
min-contentRoughly the smallest size an element can be while still fitting its longest word; the floor an item will not shrink below.MDN: Controlling ratios of flex items along the main axis
max-contentThe size an element needs to fit all its content without wrapping; what an auto basis resolves to when no width is set.MDN: Controlling ratios of flex items along the main axis
flex: noneThe predefined value 0 0 auto: a fully inflexible item that neither grows nor shrinks.MDN: Basic concepts of flexbox
flex: initialThe predefined value 0 1 auto: the behavior an item already has without any flex declaration.MDN: Basic concepts of flexbox
flex: autoThe predefined value 1 1 auto: like initial, except the item may also grow to fill the container.MDN: Basic concepts of flexbox
inflexibleDescribing an item that neither grows nor shrinks, which is what flex: none produces.MDN: Basic concepts of flexbox
flex-wrapThe property that lets flex items break onto multiple lines (wrap) instead of overflowing on one line (the default nowrap).MDN: Mastering wrapping of flex items
flex-wrap: nowrapThe initial value: items that are too wide for the container overflow it rather than breaking onto a new line.MDN: Mastering wrapping of flex items
flex-wrap: wrapThe declaration that allows items to move onto new lines as they run out of room on the current one.MDN: Mastering wrapping of flex items
gapA container property that adds fixed space between adjacent flex items and is shorthand for row-gap and column-gap.MDN: Mastering wrapping of flex items
row-gapThe longhand that sets a fixed distance between wrapped flex lines.MDN: Mastering wrapping of flex items
column-gapThe longhand that sets a fixed distance between adjacent items within a line.MDN: Mastering wrapping of flex items
align-contentThe property that distributes the set of wrapped flex lines in leftover cross-axis space, sometimes described as packing flex lines.MDN: Aligning items in a flex container
packing flex linesThe job align-content does: positioning whole lines as a group, as opposed to positioning items within their line.MDN: Aligning items in a flex container
two-dimensionalLayout that controls rows and columns together — the job of CSS Grid, not of Flexbox.MDN: Mastering wrapping of flex items
grid itemA CSS Grid child, which stays in its cell rather than stretching when the last row holds fewer items.MDN: Mastering wrapping of flex items