Skip to content
Sunsetting Yumma CSS Intellisense extension 👋

Align Items

Controls flex and grid positioning along a container's transverse axis.

Class Properties

ai-b

align-items: baseline;

ai-c

align-items: center;

ai-fe

align-items: flex-end;

ai-fs

align-items: flex-start;

ai-s

align-items: stretch;

Baseline

This example sets the align items to baseline. The items will be aligned along the baseline of the container.

A
B
C
D
E
<div class="ai-b d-g g-4 gtc-3 h-64 stripes tc-white ta-c w-full">
<div class="bg-indigo p-4 rad-1">A</div>
<div class="bg-indigo p-4 rad-1">B</div>
<div class="bg-indigo p-4 rad-1">C</div>
<div class="bg-indigo p-4 rad-1">D</div>
<div class="bg-indigo p-4 rad-1">E</div>
</div>

Center

This example sets the align items to center. The items will be centered within the container.

A
B
C
D
E
<div class="ai-c d-g g-4 gtc-3 h-64 stripes tc-white ta-c w-full">
<div class="bg-indigo p-4 rad-1">A</div>
<div class="bg-indigo p-4 rad-1">B</div>
<div class="bg-indigo p-4 rad-1">C</div>
<div class="bg-indigo p-4 rad-1">D</div>
<div class="bg-indigo p-4 rad-1">E</div>
</div>

Flex End

This example sets the align items to flex-end. The items will be aligned to the end of the container.

A
B
C
D
E
<div class="ai-fe d-g g-4 gtc-3 h-64 stripes tc-white ta-c w-full">
<div class="bg-indigo p-4 rad-1">A</div>
<div class="bg-indigo p-4 rad-1">B</div>
<div class="bg-indigo p-4 rad-1">C</div>
<div class="bg-indigo p-4 rad-1">D</div>
<div class="bg-indigo p-4 rad-1">E</div>
</div>

Flex Start

This example sets the align items to flex-start. The items will be aligned to the start of the container.

A
B
C
D
E
<div class="ai-fs d-g g-4 gtc-3 h-64 stripes tc-white ta-c w-full">
<div class="bg-indigo p-4 rad-1">A</div>
<div class="bg-indigo p-4 rad-1">B</div>
<div class="bg-indigo p-4 rad-1">C</div>
<div class="bg-indigo p-4 rad-1">D</div>
<div class="bg-indigo p-4 rad-1">E</div>
</div>

Stretch

This example sets the align items to stretch. The items will stretch to fill the container along the cross axis.

A
B
C
D
E
<div class="ai-s d-g g-4 gtc-3 h-64 stripes tc-white ta-c w-full">
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">A</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">B</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">C</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">D</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">E</div>
</div>

Conditional styles

Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.

Media modifiers

You can combine responsive breakpoints like sm:ai-*,md:ai-*, lg:ai-*, and xxl:ai-* allows targeting specific utilities in different viewports.

<div class="ai-s md:ai-e ..."></div>
Hover modifiers

Alternatively, you can apply :hover by using h:ai-* utility to override elements and change their values when hovering over them.

<div class="ai-s h:ai-e ..."></div>