CSSalign -itemsプロパティ
例
柔軟な<div>要素のすべてのアイテムの配置を中央に配置します。
div
{
display: flex;
align-items: center;
}
定義と使用法
このalign-items
プロパティは、フレキシブルコンテナ内のアイテムのデフォルトの配置を指定します。
ヒント:各アイテムのalign-selfプロパティを使用して、プロパティをオーバーライドしalign-items
ます。
デフォルト値: | ストレッチ |
---|---|
遺伝性の: | いいえ |
アニメート可能: | 番号。アニメート可能について読む |
バージョン: | CSS3 |
JavaScript構文: | object .style.alignItems = "center" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
数字の後に-webkit-が続く場合は、プレフィックスを使用して機能した最初のバージョンを指定します。
Property | |||||
---|---|---|---|---|---|
align-items | 21.0 | 11.0 | 20.0 | 9.0 7.0 -webkit- |
12.1 |
CSS構文
align-items: stretch|center|flex-start|flex-end|baseline|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
stretch | Default. Items are stretched to fit the container | |
center | Items are positioned at the center of the container | |
flex-start | Items are positioned at the beginning of the container | |
flex-end | Items are positioned at the end of the container | |
baseline | Items are positioned at the baseline of the container | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSリファレンス:align-contentプロパティ
CSSリファレンス:align-selfプロパティ
HTML DOMリファレンス:alignItemsプロパティ