0Pricing
CSS Academy · Lesson

Flex Shorthand Patterns

Master the flex shorthand and understand common values like flex: 1, flex: none, and flex: auto.

The flex Shorthand Revisited

The flex shorthand sets flex-grow, flex-shrink, and flex-basis in one declaration. Understanding the shorthand variants is essential for real-world layouts.

flex: 1

flex: 1 is equivalent to flex: 1 1 0%. Items start from zero basis and grow equally to fill available space. This is the most common equal-column shorthand.

.equal-cols > * {
  flex: 1; /* all columns equal width */
}

All lessons in this course

  1. Flex Item Alignment Override with align-self
  2. Order Property and Visual Reordering
  3. Flex Shorthand Patterns
  4. Common Flexbox Layouts: Nav Cards Media Object
← Back to CSS Academy