Skip to content

Align Content

Aligns items along the cross axis of a flex or grid container.

Class names

ClassDescription
items-startalign-items: flex-start;
items-centeralign-items: center;
items-endalign-items: flex-end;
items-baselinealign-items: baseline;
items-stretchalign-content: stretch;

Examples

Start


html
<div class="flex h-full items-start gap-4">
  <span class="bg-primary text-primary-foreground flex-1 p-2">1</span>
  <span class="bg-primary text-primary-foreground flex-1 px-2 pt-2 pb-12">2</span>
  <span class="bg-primary text-primary-foreground flex-1 p-2">3</span>
</div>

Center


html
<div class="flex h-full items-center gap-4">
  <span class="bg-primary text-primary-foreground flex-1 p-2">1</span>
  <span class="bg-primary text-primary-foreground flex-1 px-2 pt-2 pb-12">2</span>
  <span class="bg-primary text-primary-foreground flex-1 p-2">3</span>
</div>

End


html
<div class="flex h-full items-end gap-4">
  <span class="bg-primary text-primary-foreground flex-1 p-2">1</span>
  <span class="bg-primary text-primary-foreground flex-1 px-2 pt-2 pb-12">2</span>
  <span class="bg-primary text-primary-foreground flex-1 p-2">3</span>
</div>

Baseline


html
<div class="flex h-full items-baseline gap-4">
  <span class="bg-primary text-primary-foreground flex-1 p-2">1</span>
  <span class="bg-primary text-primary-foreground flex-1 px-2 pt-2 pb-12">2</span>
  <span class="bg-primary text-primary-foreground flex-1 p-2">3</span>
</div>

Stretch


html
<div class="flex h-full items-stretch gap-4">
  <span class="bg-primary text-primary-foreground flex-1 p-2">1</span>
  <span class="bg-primary text-primary-foreground flex-1 px-2 pt-2 pb-12">2</span>
  <span class="bg-primary text-primary-foreground flex-1 p-2">3</span>
</div>