Gaya alignItems Properti
Contoh
Posisikan perataan untuk semua item elemen <div> fleksibel di awal wadah:
document.getElementById("main").style.alignItems = "flex-start";
Definisi dan Penggunaan
Properti alignItems menentukan perataan default untuk item di dalam wadah fleksibel.
Tip: Gunakan properti align-self dari setiap item untuk mengganti properti align-items.
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Angka yang diikuti oleh Webkit menentukan versi pertama yang berfungsi dengan awalan.
Property | |||||
---|---|---|---|---|---|
alignItems | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
Sintaksis
Kembalikan properti alignItems:
object.style.alignItems
Setel properti alignItems:
object.style.alignItems = "stretch|center|flex-start|flex-end|baseline|initial|inherit"
Nilai properti
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 |
Detail Teknis
Nilai Bawaan: | meregang |
---|---|
Nilai Kembali: | Sebuah String, mewakili properti align-items dari suatu elemen |
Versi CSS | CSS3 |
Halaman Terkait
Referensi CSS: properti align-items
Referensi GAYA DOM HTML: properti alignContent
Referensi GAYA DOM HTML: properti alignSelf