Flexbox Advanced
Flex Grow
flex-grow controls how much a flex item grows relative to
others. Default is 0 (no growth). Higher values = more growth.
Flex Shrink
flex-shrink controls how much a flex item shrinks when
space is limited. Default is 1. Set to 0 to prevent shrinking.
Flex Basis
flex-basis sets the initial size of a flex item before
growing or shrinking. Think of it as the starting width/height.
Flex Shorthand
The flex property combines grow, shrink, and basis:
flex: grow shrink basis. Common values:
flex: 1 (grow equally), flex: none
(don't grow/shrink).
Flex Wrap
flex-wrap controls whether items wrap to new
lines. Values: nowrap (default),
wrap, wrap-reverse.
Align Self
align-self overrides
align-items for individual flex items.
Perfect for making one item behave differently!
Order
The order property changes the visual
order of flex items without changing HTML. Default
is 0. Lower values appear first.
flex: 1 on items to make them
grow equally and fill available space.
Perfect for equal-width columns!
Summary
flex-grow- How much item grows (default: 0)flex-shrink- How much item shrinks (default: 1)flex-basis- Initial size before grow/shrinkflex- Shorthand: grow shrink basisflex-wrap- Allow items to wrap (nowrap, wrap)align-self- Override align-items for one itemorder- Change visual order (default: 0)
Quick Quiz
Which property makes flex items wrap to new lines?
Enjoying these tutorials?