Propriété CSS align-self
Exemple
Centrez les alignements pour l'un des éléments à l'intérieur d'un élément flexible :
#myBlueDiv
{
align-self: center;
}
Définition et utilisation
La align-self
propriété spécifie l'alignement de l'élément sélectionné à l'intérieur du conteneur flexible.
Remarque : La align-self
propriété remplace la propriété
align-items du conteneur flexible .
Valeur par défaut: | auto |
---|---|
Hérité: | non |
Animable : | non. En savoir plus sur l'animation |
Version: | CSS3 |
Syntaxe JavaScript : | objet .style.alignSelf="center" |
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- spécifient la première version qui a fonctionné avec un préfixe.
Property | |||||
---|---|---|---|---|---|
align-self | 21.0 | 11.0 | 20.0 | 9.0 7.0 -webkit- |
12.1 |
Syntaxe CSS
align-self: auto|stretch|center|flex-start|flex-end|baseline|initial|inherit;
Valeurs de propriété
Value | Description | Play it |
---|---|---|
auto | Default. The element inherits its parent container's align-items property, or "stretch" if it has no parent container | |
stretch | The element is positioned to fit the container | |
center | The element is positioned at the center of the container | |
flex-start | The element is positioned at the beginning of the container | |
flex-end | The element is positioned at the end of the container | |
baseline | The element is positioned at the baseline of the container | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Pages connexes
Référence CSS : propriété align-content
Référence CSS : propriété align-items
Référence HTML DOM : propriété alignSelf