CSS flex Property Explained

What the CSS flex property does, with an example.

Published November 3, 2026

The CSS flex property a shorthand for flex-grow, flex-shrink, and flex-basis, controlling how a flex item grows or shrinks.

Key points

  • Check browser compatibility on a resource like caniuse.com if targeting older browsers

Example

flex: 1;
More CSS articles