Flexbox & Grid

align-self

Utilities for controlling how an individual flex or grid item is positioned along its container's cross axis.

ClassStyles
self-auto
align-self: auto;
self-start
align-self: flex-start;
self-end
align-self: flex-end;
self-center
align-self: center;
self-stretch
align-self: stretch;
self-baseline
align-self: baseline;

Examples

Auto

Use self-auto to align an item based on the value of the container's align-items property:

01
02
03
<div class="flex items-stretch ...">  <div>01</div>  <div class="self-auto ...">02</div>  <div>03</div></div>

Start

Use self-start to align an item to the start of the container's cross axis, despite the container's align-items value:

01
02
03
<div class="flex items-stretch ...">  <div>01</div>  <div class="self-start ...">02</div>  <div>03</div></div>

Center

Use self-center to align an item along the center of the container's cross axis, despite the container's align-items value:

01
02
03
<div class="flex items-stretch ...">  <div>01</div>  <div class="self-center ...">02</div>  <div>03</div></div>

End

Use self-end to align an item to the end of the container's cross axis, despite the container's align-items value:

01
02
03
<div class="flex items-stretch ...">  <div>01</div>  <div class="self-end ...">02</div>  <div>03</div></div>

Stretch

Use self-stretch to stretch an item to fill the container's cross axis, despite the container's align-items value:

01
02
03
<div class="flex items-stretch ...">  <div>01</div>  <div class="self-stretch ...">02</div>  <div>03</div></div>

Responsive design

Prefix an align-self utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

<div class="self-auto md:self-end ...">  <!-- ... --></div>

Learn more about using variants in the variants documentation.

Copyright © 2025 Tailwind Labs Inc.·Trademark Policy

Tailwind CSS 中文网(本网站)的目标是为中文开发者提供准确、及时的 Tailwind CSS 中文文档

Tailwind CSS 中文文档由本网站维护人员共同翻译,采用 MIT 开源协议发布

本网站与 tailwindcss.com 及 Tailwind Labs Inc. 并无从属关系

Tailwind 商标由 Tailwind Labs Inc. 所有

京ICP备15031610号-8