CSS辞書

place-content

レイアウト・配置

align-contentとjustify-contentを一括で設定するショートハンドプロパティです。

構文

Syntax
place-content: <align-content> <justify-content>

Tailwindでは

place-content-centerplace-content: center
place-content-betweenplace-content: space-between

コード例

1

.flex-container { display: flex; flex-wrap: wrap; place-content: center; }
実行結果
Item 1
Item 2
Item 3

フレックスコンテンツを中央配置

2

place-content: space-between center;
実行結果
A
B
C

垂直方向は均等配置、水平方向は中央配置

💡 TIPS

複数行のFlexboxやGridで威力を発揮。

🤖 AIがよく間違えるポイント

place-itemsが「各セル内のアイテム」の配置なのに対し、place-contentは「トラック群全体」の配置です。AIはこの2つを混同した説明をよくします。コンテンツ全体をコンテナ中央に置くのがplace-content、各セルの中でアイテムを中央に置くのがplace-itemsです。

💬 AIへの頼み方

gridでトラック全体をコンテナ中央に配置したい。place-contentとplace-itemsの違いを踏まえて書いて

そのままAIチャットに貼り付けて使える依頼文の例です。ページ上部の「AI用にコピー」でこのページ全体をコンテキストとして渡せます。

関連プロパティ

このプロパティを使ったUIレシピ

ブラウザサポート

Baseline 広く利用可能
Chrome
59+
Firefox
45+
Safari
9+
Edge
79+