Gaya alignSelf Property
Contoh
Atur perataan untuk salah satu item di dalam elemen fleksibel agar sesuai dengan wadah:
document.getElementById("myBlueDiv").style.alignSelf = "stretch";
Definisi dan Penggunaan
Properti alignSelf menentukan perataan untuk item yang dipilih di dalam wadah fleksibel.
Catatan: Properti alignSelf menimpa properti alignItems wadah fleksibel.
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 | |||||
---|---|---|---|---|---|
alignSelf | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
Sintaksis
Kembalikan properti alignSelf:
object.style.alignSelf
Setel properti alignSelf:
object.style.alignSelf = "auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
Nilai properti
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 |
Detail Teknis
Nilai Bawaan: | mobil |
---|---|
Nilai Kembali: | Sebuah String, mewakili properti align-self dari suatu elemen |
Versi CSS | CSS3 |
Halaman Terkait
Referensi CSS: align-self property
Referensi GAYA DOM HTML: properti alignContent
Referensi GAYA DOM HTML: properti alignItems