Presets

Container

flex-direction?Sets the main axis. row = left→right, column = top→bottom. -reverse variants flip the order.

flex-wrap?Controls whether items stay on one line (nowrap) or wrap to new lines when they overflow.

justify-content?Distributes items along the main axis. Controls spacing between and around items.

align-items?Aligns items along the cross axis (perpendicular to main axis) within a single line.

align-content?Aligns lines when there is extra space in the cross axis. Only applies when flex-wrap is wrap.

row-gap: 8px?Sets the gutter size between flex items. row-gap affects space between rows, column-gap between columns.

column-gap: 8px

Items (3)

Item 1
Item 2
Item 3

Live Preview

10/1/auto
20/1/auto
30/1/auto
.container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  align-content: flex-start;
  gap: 8px;
}

.item-1 {
  flex-grow: 0;
  flex-shrink: 1;
  flex-basis: auto;
}

.item-2 {
  flex-grow: 0;
  flex-shrink: 1;
  flex-basis: auto;
}

.item-3 {
  flex-grow: 0;
  flex-shrink: 1;
  flex-basis: auto;
}

HTML

<div class="container">
  <div class="item item-1">Item 1</div>
  <div class="item item-2">Item 2</div>
  <div class="item item-3">Item 3</div>
</div>

All processing happens in your browser. Nothing is sent to a server.

Powered by OptiPix Flexbox Playground - free, private, in-browser

Flexbox Playground (Embed) | OptiPix.art