CSS align-self Właściwość
Przykład
Wyśrodkuj wyrównania jednego z elementów wewnątrz elastycznego elementu:
#myBlueDiv
{
align-self: center;
}
Definicja i użycie
Właściwość align-self
określa wyrównanie wybranego elementu wewnątrz elastycznego kontenera.
Uwaga: Właściwość align-self
zastępuje właściwość
align-items elastycznego kontenera .
Domyślna wartość: | automatyczny |
---|---|
Dziedziczny: | nie |
Animowalny: | nie. Przeczytaj o animacji |
Wersja: | CSS3 |
Składnia JavaScript: | obiekt .style.alignSelf="center" |
Obsługa przeglądarki
Liczby w tabeli określają pierwszą wersję przeglądarki, która w pełni obsługuje tę właściwość.
Liczby, po których następuje -webkit- określają pierwszą wersję, która działała z przedrostkiem.
Property | |||||
---|---|---|---|---|---|
align-self | 21.0 | 11.0 | 20.0 | 9.0 7.0 -webkit- |
12.1 |
Składnia CSS
align-self: auto|stretch|center|flex-start|flex-end|baseline|initial|inherit;
Wartości nieruchomości
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 |
Powiązane strony
Dokumentacja CSS: właściwość wyrównania treści
Dokumentacja CSS: właściwość align-items
Odniesienie HTML DOM: właściwość alignSelf