Propriété CSS flex-basis
Exemple
Définissez la longueur initiale du deuxième élément flexible sur 100 pixels :
div:nth-of-type(2) {
flex-basis:
100px;
}
Définition et utilisation
La flex-basis
propriété spécifie la longueur initiale d'un élément flexible.
Remarque : Si l'élément n'est pas un élément flexible, la flex-basis
propriété n'a aucun effet.
Valeur par défaut: | auto |
---|---|
Hérité: | non |
Animable : | Oui. En savoir plus sur l'animation |
Version: | CSS3 |
Syntaxe JavaScript : | objet .style.flexBasis="200px" |
Prise en charge du navigateur
Les nombres dans le tableau indiquent la première version du navigateur qui prend entièrement en charge la propriété.
Les nombres suivis de -webkit- ou -moz- spécifient la première version qui a fonctionné avec un préfixe.
Property | |||||
---|---|---|---|---|---|
flex-basis | 29.0 21.0 -webkit- |
11.0 | 28.0 18.0 -moz- |
9.0 6.1 -webkit- |
17.0 |
Syntaxe CSS
flex-basis: number|auto|initial|inherit;
Valeurs de propriété
Value | Description | Play it |
---|---|---|
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 |
Pages connexes
Tutoriel CSS : Boîte flexible CSS
Référence CSS : propriété flex
Référence CSS : propriété flex-direction
Référence CSS : propriété flex-flow
Référence CSS : propriété flex-grow
Référence CSS : propriété flex-shrink
Référence CSS : propriété flex-wrap
Référence HTML DOM : propriété flexBasis