スタイルalignItemsプロパティ
例
コンテナの先頭に、flexible <div>要素のすべてのアイテムの配置を配置します。
document.getElementById("main").style.alignItems = "flex-start";
定義と使用法
alignItemsプロパティは、フレキシブルコンテナ内のアイテムのデフォルトの配置を指定します。
ヒント:各アイテムのalign-selfプロパティを使用して、align-itemsプロパティをオーバーライドします。
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
数字の後にWebkitが続く場合は、プレフィックスを使用して機能した最初のバージョンを指定します。
Property | |||||
---|---|---|---|---|---|
alignItems | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
構文
alignItemsプロパティを返します。
object.style.alignItems
alignItemsプロパティを設定します。
object.style.alignItems = "stretch|center|flex-start|flex-end|baseline|initial|inherit"
プロパティ値
Value | Description |
---|---|
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 |
技術的な詳細
デフォルト値: | ストレッチ |
---|---|
戻り値: | 要素のalign-itemsプロパティを表す文字列 |
CSSバージョン | CSS3 |
関連ページ
CSSリファレンス:align-itemsプロパティ
HTML DOM STYLEリファレンス:alignContentプロパティ
HTML DOM STYLEリファレンス:alignSelfプロパティ