flex-shrink

W3C CSS Snapshot 2026

Set how much an item can shrink when the combined starting sizes exceed the space. The browser weights the factor by the flex base size.

On this page

Syntax and values

Value or syntaxWhat it does
0Prevents shrinkage from flex sizing. The line can overflow.
1The default shrink factor.
2 / 0.5Another nonnegative factor. With equal starting sizes, 2 requests more shrinkage than 1.

Try the example

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>flex-shrink example</title>
  <style>
.layout { display: flex; width: min(100%, 320px); border: 2px solid teal; box-sizing: border-box; }
.layout > div { padding: 8px 12px; background: #def5f5; color: #123; border: 1px solid #81b9b5; box-sizing: border-box; }
.layout { max-width: 260px; }
.layout > div { flex-basis: 110px; min-width: 0; }
.layout .first { flex-shrink: 0; }
  </style>
</head>
<body>
<div class="layout">
  <div class="first">A</div>
  <div class="second">B</div>
  <div>C</div>
</div>
</body>
</html>

What to expect A keeps its starting width while B and C shrink. Change A to flex-shrink: 2 and compare.

Official references