Style alignSelf Property
Przykład
Ustaw wyrównania dla jednego z elementów wewnątrz elastycznego elementu, aby pasował do kontenera:
document.getElementById("myBlueDiv").style.alignSelf = "stretch";
Definicja i użycie
Właściwość alignSelf określa wyrównanie wybranego elementu wewnątrz elastycznego kontenera.
Uwaga: Właściwość alignSelf zastępuje właściwość alignItems elastycznego kontenera.
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 | |||||
---|---|---|---|---|---|
alignSelf | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
Składnia
Zwróć właściwość alignSelf:
object.style.alignSelf
Ustaw właściwość alignSelf:
object.style.alignSelf = "auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
Wartości nieruchomości
Value | Description |
---|---|
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 conatiner |
center | The element is positioned at the center of the container |
flex-start | The element is are 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 |
Szczegóły techniczne
Domyślna wartość: | automatyczny |
---|---|
Wartość zwrotu: | String, reprezentujący właściwość align-self elementu |
Wersja CSS | CSS3 |
Powiązane strony
Odniesienie CSS: align-self własność
Dokumentacja HTML DOM STYLE: właściwość alignContent
Dokumentacja HTML DOM STYLE: właściwość alignItems