Propriété de style JustifyContent
Exemple
Faites de l'espace entre les éléments de l'élément flexible <div> :
document.getElementById("main").style.justifyContent = "space-between";
Définition et utilisation
La propriété justifierContent aligne les éléments du conteneur flexible lorsque les éléments n'utilisent pas tout l'espace disponible sur l'axe principal (horizontalement).
Astuce : Utilisez la propriété alignContent pour aligner les éléments sur l'axe transversal (verticalement).
Prise en charge du navigateur
Property | |||||
---|---|---|---|---|---|
justifyContent | Yes | 12.0 | Yes | 9.0 | Yes |
Syntaxe
Renvoyez la propriété justifierContent :
object.style.justifyContent
Définissez la propriété JustifyContent :
object.style.justifyContent = "flex-start|flex-end|center|space-between|space-around|initial|inherit"
Valeurs de propriété
Value | Description |
---|---|
flex-start | Default value. Items are positioned at the beginning of the container |
flex-end | Items are positioned at the end of the container |
center | Items are positioned at the center of the container |
space-between | Items are positioned with space between the lines |
space-around | Items are positioned with space before, between, and after the lines |
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: | flex-start |
---|---|
Valeur de retour : | Une chaîne, représentant la propriété justifier-content d'un élément |
Version CSS | CSS3 |
Pages connexes
Référence CSS : propriété justifier-content
Référence HTML DOM STYLE : propriété alignContent
Référence HTML DOM STYLE : propriété alignItems
Référence HTML DOM STYLE : propriété alignSelf
❮ Objet de style