Align Self
Controls the positioning of a single flex or grid element along the transverse axis of its container.
| Class | Style |
|---|---|
as-auto | align-self: auto |
as-b | align-self: baseline |
as-c | align-self: center |
as-fe | align-self: flex-end |
as-fs | align-self: flex-start |
as-st | align-self: stretch |
Auto
Initial value
The item will use the default alignment based on the container's alignment properties.
<div class="d-f g-4 h-24 w-full" id="area"> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">A</div> <div class="ai-c as-auto bg-indigo d-f f-1 jc-c p-4 rad-1 tc-white">B</div> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">C</div></div>Baseline
The item will be aligned along the baseline of the container.
<div class="d-f g-4 h-24 w-full" id="area"> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">A</div> <div class="ai-c as-b bg-indigo d-f f-1 jc-c p-4 rad-1 tc-white">B</div> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">C</div></div>Center
The item will be centered within its container.
<div class="d-f g-4 h-24 w-full" id="area"> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">A</div> <div class="ai-c as-c bg-indigo d-f f-1 jc-c p-4 rad-1 tc-white">B</div> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">C</div></div>Flex-End
The item will be aligned to the end of its container.
<div class="d-f g-4 h-24 w-full" id="area"> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">A</div> <div class="ai-c as-fe bg-indigo d-f f-1 jc-c p-4 rad-1 tc-white">B</div> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">C</div></div>Flex-Start
The item will be aligned to the start of its container.
<div class="d-f g-4 h-24 w-full" id="area"> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">A</div> <div class="ai-c as-fs bg-indigo d-f f-1 jc-c p-4 rad-1 tc-white">B</div> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">C</div></div>Stretch
The item will stretch to fill its container along the cross axis.
<div class="d-f g-4 h-24 w-full" id="area"> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">A</div> <div class="ai-c as-s bg-indigo d-f f-1 jc-c p-4 rad-1 tc-white">B</div> <div class="ai-c bg-indigo-8 d-f f-1 jc-c p-4 rad-1 tc-indigo-5">C</div></div>Using utility variants
Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.
Using media queries
You can combine responsive breakpoints like sm:as-*, md:as-*, lg:as-*, and xxl:as-* to allow targeting specific utilities in different viewports.
Using hover states
Alternatively, you can apply :hover by using h:as-* utility to override elements and change their values when hovering over them.