A wrapping row with gap
display: flex;
flex-wrap: wrap;
gap: 8px;
justify-content: flex-start;Default row direction, wrapping, and gap between controls, matching the idea of the tutorial .actions rule.
- gap: 8px sets both row-gap and column-gap. It does not collapse with the buttons’ margins.
<div class="actions">
<button type="button">Plant</button>
<button type="button">Water</button>
<button type="button">Harvest</button>
</div>
<style>
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.actions button { font: inherit; }
</style>What this markup means
The container is a row flex container that may wrap. The three buttons start on the main axis with 8px gutters from gap. They will not automatically form equal grid-like columns when they wrap, because Flexbox is one-dimensional.
Related: CSS tutorial: layout, Display, Grid