CSS menyelaraskan-diri Properti
Contoh
Pusatkan perataan untuk salah satu item di dalam elemen fleksibel:
#myBlueDiv
{
align-self: center;
}
Definisi dan Penggunaan
Properti align-self
menentukan perataan untuk item yang dipilih di dalam wadah fleksibel.
Catatan: Properti align-self
menimpa properti
align-items container yang fleksibel .
Nilai bawaan: | mobil |
---|---|
Diwarisi: | tidak |
Animasi: | tidak. Baca tentang animasi |
Versi: kapan: | CSS3 |
Sintaks JavaScript: | objek .style.alignSelf="center" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Angka diikuti oleh -webkit- menentukan versi pertama yang berfungsi dengan awalan.
Property | |||||
---|---|---|---|---|---|
align-self | 21.0 | 11.0 | 20.0 | 9.0 7.0 -webkit- |
12.1 |
Sintaks CSS
align-self: auto|stretch|center|flex-start|flex-end|baseline|initial|inherit;
Nilai properti
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 |
Halaman Terkait
Referensi CSS: properti align-content
Referensi CSS: properti align-items
Referensi DOM HTML: properti alignSelf