スタイルalignSelfプロパティ
例
コンテナに合うように、フレキシブル要素内のアイテムの1つの配置を設定します。
document.getElementById("myBlueDiv").style.alignSelf = "stretch";
定義と使用法
alignSelfプロパティは、フレキシブルコンテナ内の選択されたアイテムの配置を指定します。
注: alignSelfプロパティは、フレキシブルコンテナのalignItemsプロパティをオーバーライドします。
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
数字の後にWebkitが続く場合は、プレフィックスを使用して機能した最初のバージョンを指定します。
Property | |||||
---|---|---|---|---|---|
alignSelf | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
構文
alignSelfプロパティを返します。
object.style.alignSelf
alignSelfプロパティを設定します。
object.style.alignSelf = "auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
プロパティ値
Value | Description |
---|---|
auto | Default. The element inherits its parent container's align-items property, or "stretch" if it has no parent container |
stretch | The element is positioned to fit the conatiner |
center | The element is positioned at the center of the container |
flex-start | The element is are positioned at the beginning of the container |
flex-end | The element is positioned at the end of the container |
baseline | The element is 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-selfプロパティを表す文字列 |
CSSバージョン | CSS3 |
関連ページ
CSSリファレンス:align-selfプロパティ
HTML DOM STYLEリファレンス:alignContentプロパティ
HTML DOM STYLEリファレンス:alignItemsプロパティ