1. Flexbox & Grid
  2. justify-self

Flexbox & Grid

justify-self

個々のグリッドアイテムがインライン軸に沿ってどのように配置されるかを制御するためのユーティリティ。

クラススタイル
justify-self-auto
justify-self: auto;
justify-self-start
justify-self: start;
justify-self-center
justify-self: center;
justify-self-center-safe
justify-self: safe center;
justify-self-end
justify-self: end;
justify-self-end-safe
justify-self: safe end;
justify-self-stretch
justify-self: stretch;

自動

justify-self-autoユーティリティを使用して、グリッドのjustify-itemsプロパティの値に基づいてアイテムを配置します。

01
02
03
04
05
06
<div class="grid justify-items-stretch ...">
<!-- ... -->
<div class="justify-self-auto ...">02</div>
<!-- ... -->
</div>

開始

justify-self-startユーティリティを使用して、グリッドアイテムをインライン軸の開始位置に配置します。

01
02
03
04
05
06
<div class="grid justify-items-stretch ...">
<!-- ... -->
<div class="justify-self-start ...">02</div>
<!-- ... -->
</div>

中央

justify-self-centerまたはjustify-self-center-safeユーティリティを使用して、グリッドアイテムをインライン軸の中央に沿って配置します。

コンテナのサイズを変更して、配置の動作を確認してください。

justify-center-end

01
02
03

justify-self-center-safe

01
02
03
justify-self-center
<div class="grid justify-items-stretch ...">
<!-- ... -->
<div class="justify-self-center ...">02</div>
<!-- ... -->
</div>
justify-self-center-safe
<div class="grid justify-items-stretch ...">
<!-- ... -->
<div class="justify-self-center-safe ...">02</div>
<!-- ... -->
</div>

十分なスペースがない場合、justify-self-center-safeユーティリティは、アイテムを終端ではなくコンテナの始端に配置します。

終端

justify-self-endまたはjustify-self-end-safeユーティリティを使用して、グリッドアイテムをインライン軸の終端に配置します。

コンテナのサイズを変更して、配置の動作を確認してください。

justify-self-end

01
02
03

justify-self-end-safe

01
02
03
justify-self-end
<div class="grid justify-items-stretch ...">
<!-- ... -->
<div class="justify-self-end ...">02</div>
<!-- ... -->
</div>
justify-self-end-safe
<div class="grid justify-items-stretch ...">
<!-- ... -->
<div class="justify-self-end-safe ...">02</div>
<!-- ... -->
</div>

十分なスペースがない場合、justify-self-end-safeユーティリティは、アイテムを終端ではなくコンテナの始端に配置します。

ストレッチ

justify-self-stretchユーティリティを使用して、グリッドアイテムをインライン軸上のグリッド領域全体に引き伸ばします。

01
02
03
04
05
06
<div class="grid justify-items-start ...">
<!-- ... -->
<div class="justify-self-stretch ...">02</div>
<!-- ... -->
</div>

レスポンシブデザイン

プレフィックスa justify-selfユーティリティ md:のようなブレークポイントバリアントとともに使用して、ユーティリティを適用するmedium 画面サイズ以上

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

バリアントのドキュメントで、バリアントの使用方法の詳細をご覧ください。

著作権 © 2025 Tailwind Labs Inc.·商標ポリシー