Flex Items

flex-grow, flex-shrink, flex-basis

PropertyMeaning
flex-growshare of the free space the item takes (0 = do not grow)
flex-shrinkhow much it shrinks when space is short (0 = never shrink)
flex-basisstarting size before growing/shrinking
flex: 1shorthand: grow 1, shrink 1, basis 0: equal columns
align-selfoverride align-items for one item
ordervisual order (does not change reading order for screen readers)

Example

Example

The middle item takes twice as much free space as the others; the last one is fixed at 100px:

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
  <style>
    .container { display: flex; gap: 8px; }
    .container > div { background: #04AA6D; color: white; padding: 10px 16px; font: 15px Arial; }
    .a { flex: 1; }
    .b { flex: 2; }
    .c { flex: 0 0 100px; }
  </style>
</head>
<body>

<div class="container"><div class="a">flex: 1</div><div class="b">flex: 2</div><div class="c">100px</div></div>

</body>
</html>

Result