Browse documentation

Reference / Flexbox & grid

Gap

Set the gutters between flex or grid items. Horizontal and vertical gutters can use different spacing values.

Working example

Gap only separates adjacent tracks or items. Add padding to the container when the outer edge needs space too.

HTML
<div class="grid grid-cols-2 gap-x-6 gap-y-2">
  <span class="border p-2">Paper</span><span class="border p-2">Ink</span>
  <span class="border p-2">Binding</span><span class="border p-2">Cover</span>
</div>

Class reference

ClassCSS declarations
gap-0gap: 0px;
gap-2gap: 0.5rem;
gap-4gap: 1rem;
gap-x-6column-gap: 1.5rem;
gap-y-2row-gap: 0.5rem;
gap-[12px]gap: 12px;
View full generated CSS
Compiled CSS
.gap-0 {
  gap: 0px;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-4 {
  gap: 1rem;
}
.gap-\[12px\] {
  gap: 12px;
}
.gap-x-6 {
  column-gap: 1.5rem;
}
.gap-y-2 {
  row-gap: 0.5rem;
}