Propriété de style flexShrink
Exemple
Laissez l'élément DIV bleu rétrécir cinq fois plus que le reste des éléments flexibles :
document.getElementById("myBlueDiv".style.flexShrink = "5";
Définition et utilisation
La propriété flexShrink spécifie comment l'élément sera réduit par rapport au reste des éléments flexibles à l'intérieur du même conteneur.
Remarque : Si l'élément n'est pas un élément flexible, la propriété flexShrink n'a aucun effet.
Prise en charge du navigateur
Property | |||||
---|---|---|---|---|---|
flexShrink | Yes | 11.0 | Yes | 9.0 | Yes |
Syntaxe
Renvoyez la propriété flexShrink :
object.style.flexShrink
Définissez la propriété flexShrink :
object.style.flexShrink = "number|initial|inherit"
Valeurs de propriété
Value | Description |
---|---|
number | A number specifying how much the item will shrink relative to the rest of the flexible items. Default value is 0 |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Détails techniques
Valeur par défaut: | 1 |
---|---|
Valeur de retour : | Une chaîne, représentant la propriété flex-shrink d'un élément |
Version CSS | CSS3 |
Pages connexes
Référence CSS : propriété flex-shrink
Référence HTML DOM STYLE : propriété flex
Référence HTML DOM STYLE : propriété flexBasis
Référence HTML DOM STYLE : propriété flexDirection
Référence HTML DOM STYLE : propriété flexFlow
Référence HTML DOM STYLE : propriété flexGrow
Référence HTML DOM STYLE : propriété flexWrap
❮ Objet de style