Posts tagged “flexbox”
- column-reverse and the chat scroll-anchor pattern —
column-reverse with overflow:auto anchors a chat to the latest message without JavaScript.
- safe and unsafe alignment —
Safe and unsafe keywords control whether oversized flex items can scroll out of reach.
- aspect-ratio meets flex —
aspect-ratio with flex removes the padding-bottom media-card hack.
- the min-width: auto trap —
Flex items default to min-width:auto — long words and big images blow layouts out.
- auto margins in flex are a feature —
margin:auto on a flex item absorbs free space — the push-to-the-end trick.
- flex-basis vs width: which one wins —
Set both flex-basis and width and one silently loses. The rule is simple.
- align-content: the property tutorials skip —
align-content does nothing on a single line. Wrap, and it owns the cross axis.
- flex-wrap and the mythical flex line —
flex-wrap turns one flex line into many independent lines stacked on the cross axis.
- order considered harmful —
flex order reorders boxes visually but leaves tab and screen-reader order alone.
- gap is the flex property you forget —
CSS gap in flexbox replaces margin hacks and :not(:last-child) selectors.
- justify vs align: which axis —
justify-content is main axis; align-items is cross axis. Flip direction and they swap.
- min-content, max-content, fit-content —
Intrinsic sizing keywords name the minimum that flex overflow fights against.
- flex-grow, shrink, and basis —
The flex shorthand is three properties. Know each one before writing flex: 1.