flex-shrink

Defines how a flex item shrinks when the container has less space than the sum of its items.
  • Default value: 1 (does shrink).
  • If you set 0, that item will not shrink even if space is lacking.

Example

All three items start from flex-basis: 12rem. The child-1 item does not shrink because its flex-shrink is 0, while the others shrink since theirs is 1. Move the width control to see it.

ResultLive
html
css