Propriedade de estilo flexBasis
Exemplo
Defina o comprimento inicial de um flex-item para 200 pixels:
document.getElementById("myBlueDiv").style.flexBasis = "200px";
Definição e uso
A propriedade flexBasis especifica o comprimento inicial de um item flexível.
Nota: Se o elemento não for um item flexível, a propriedade flexBasis não terá efeito.
Suporte ao navegador
Property | |||||
---|---|---|---|---|---|
flexBasis | Yes | 11.0 | Yes | 9.0 | Yes |
Sintaxe
Retorne a propriedade flexBasis:
object.style.flexBasis
Defina a propriedade flexBasis:
object.style.flexBasis = "number|auto|initial|inherit"
Valores de propriedade
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 |
Detalhes técnicos
Valor padrão: | auto |
---|---|
Valor de retorno: | Uma String, representando a propriedade flex-basis de um elemento |
Versão CSS | CSS3 |
Páginas relacionadas
Referência CSS: propriedade flex-basis
Referência HTML DOM STYLE: propriedade flex
Referência HTML DOM STYLE: propriedade flexDirection
Referência HTML DOM STYLE: propriedade flexFlow
Referência HTML DOM STYLE: propriedade flexGrow
Referência HTML DOM STYLE: propriedade flexShrink
Referência HTML DOM STYLE: propriedade flexWrap
❮ Objeto de estilo