Converter Web ToolsConverter WebTools

CSS Flexbox Cheat Sheet

This CSS Flexbox cheat sheet lists the flex container and item properties for building one-dimensional layouts — aligning, spacing and ordering elements.

Container (parent)

PropertyWhat it does
display: flexMake a flex container
flex-direction: row | columnMain axis direction
justify-content: centerAlign along main axis
align-items: centerAlign along cross axis
flex-wrap: wrapAllow wrapping
gap: 1remSpace between items

Items (children)

PropertyWhat it does
flex: 1Grow to fill space
flex-grow: 1Growth factor
flex-shrink: 0Prevent shrinking
flex-basis: 200pxBase size
align-self: flex-endOverride cross-axis align
order: 2Reorder an item

Related tools & charts