Styl alignItems Property
Przykład
Umieść wyrównania dla wszystkich elementów elastycznego elementu <div> na początku kontenera:
document.getElementById("main").style.alignItems = "flex-start";
Definicja i użycie
Właściwość alignItems określa domyślne wyrównanie elementów wewnątrz elastycznego kontenera.
Porada: Użyj właściwości align-self każdego elementu, aby zastąpić właściwość align-items.
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 | |||||
---|---|---|---|---|---|
alignItems | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
Składnia
Zwróć właściwość alignItems:
object.style.alignItems
Ustaw właściwość alignItems:
object.style.alignItems = "stretch|center|flex-start|flex-end|baseline|initial|inherit"
Wartości nieruchomości
Value | Description |
---|---|
stretch | Default. Items are stretched to fit the container |
center | Items are positioned at the center of the container |
flex-start | Items are positioned at the beginning of the container |
flex-end | Items are positioned at the end of the container |
baseline | Items are 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ść: | rozciągać |
---|---|
Wartość zwrotu: | String, reprezentujący właściwość align-items elementu |
Wersja CSS | CSS3 |
Powiązane strony
Dokumentacja CSS: właściwość align-items
Dokumentacja HTML DOM STYLE: właściwość alignContent
HTML DOM STYLE Reference: właściwość alignSelf