Dev Helpers

CSS / Flexbox

Horizontal flex row

Dev Helpers · July 1, 2025

A flex row lays out siblings on its main axis. The children's minimum sizes determine how gracefully the row shrinks.

Worked example

<style>
  .demo {
    display: flex;
    gap: 0.5rem;
  }
</style>
<div class="demo">
  <span class="tile">One</span><span class="tile">Two</span
  ><span class="tile">Three</span>
</div>

Implementation notes

An intrinsic minimum can stop flex items from yielding space. Allow shrinking on the label while protecting controls that need a usable hit area.

Try it yourself

Add a long unbroken identifier and reduce the container width.

Open the CSS example →

Editorial date July 1, 2025 · Published December 6, 2026

Related articles

Fluid width with a maximum

A fluid container needs a small-screen width and a large-screen maximum. Outer gutters should remain visible at both extremes.

Square aspect ratio

A square ratio reserves equal sides even before media loads. Fit rules decide whether rectangular content is cropped or letterboxed.