CSS flex Property Reference

The CSS flex property is a standard property in CSS Flexible Box Layout. Review its formal syntax, computed behavior, and practical declarations.

CSS flex Property Reference

The CSS flex property is a standard property in CSS Flexible Box Layout. Review its formal syntax, computed behavior, and practical declarations.

Updated 2026-08-12

flex overview

The CSS flex property is a standard property in CSS Flexible Box Layout. Review its formal syntax, computed behavior, and practical declarations.

The property is not inherited by default. Use an explicit global keyword when inheritance is intended.

Syntax and formal definition

flex formal syntax
FieldValue
Formal syntaxnone | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]
Initial valueflex-grow, flex-shrink, flex-basis
Applies toflexItemsAndInFlowPseudos
InheritedNo
Percentagesno
Computed valueflex-grow, flex-shrink, flex-basis
Animation typeflex-grow, flex-shrink, flex-basis
Mediavisual
Specification groupCSS Flexible Box Layout
StatusStandard

Practical examples

These declarations demonstrate valid ways to set flex. The initial and inherit global keywords remain available even when a property-specific value is preferable.

flex live example
CSS .reset-example { flex: initial; } .inherit-example { flex: inherit; } @supports (flex: 1 1 auto) { .supported { flex: 1 1 auto; } }

Description

The CSS flex property is a standard property in CSS Flexible Box Layout. Review its formal syntax, computed behavior, and practical declarations.

References

  1. MDN: flex
  2. MDN: CSS Properties Reference

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies