スタイルflexBasisプロパティ
例
フレックスアイテムの初期の長さを200ピクセルに設定します。
document.getElementById("myBlueDiv").style.flexBasis = "200px";
定義と使用法
flexBasisプロパティは、フレキシブルアイテムの初期の長さを指定します。
注:要素がフレキシブルアイテムでない場合、flexBasisプロパティは効果がありません。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
flexBasis | Yes | 11.0 | Yes | 9.0 | Yes |
構文
flexBasisプロパティを返します。
object.style.flexBasis
flexBasisプロパティを設定します。
object.style.flexBasis = "number|auto|initial|inherit"
プロパティ値
Value | Description |
---|---|
number | A length unit, or percentage, specifying the initial length of the flexible item(s) |
auto | Default value. The length is equal to the length of the flexible item. If the item has no length specified, the length will be according to its content |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | 自動 |
---|---|
戻り値: | 要素のflex-basisプロパティを表す文字列 |
CSSバージョン | CSS3 |
関連ページ
CSSリファレンス:flex-basisプロパティ
HTML DOM STYLEリファレンス:flexプロパティ
HTML DOM STYLEリファレンス:flexDirectionプロパティ
HTML DOM STYLEリファレンス:flexFlowプロパティ
HTML DOM STYLEリファレンス:flexGrowプロパティ
HTML DOM STYLEリファレンス:flexShrinkプロパティ
HTML DOM STYLEリファレンス:flexWrapプロパティ
❮スタイルオブジェクト