On this page
  1. flex
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

flex

Prev: `display` | Up: layout | Next: `justify-content`
Rel: layout, Display & Layout Guide
Ref: MDN Web Docs — flex
Tags: #public #web #css #properties #layout #tier/core


Syntax & Overview

flex: <grow> <shrink> <basis>;

Shorthand controlling how a flex item grows and shrinks along the main axis.

Notes & Best Practices

Example

.row { display: flex; gap: 1rem; }
.row > .main { flex: 1 1 0%; min-width: 0; }
.row > .aside { flex: 0 0 18rem; }

Linked from

Related notes