Properti celah kolom CSS
Contoh
Tentukan celah 40 piksel di antara kolom:
div
{
column-gap: 40px;
}
Lebih banyak contoh "Coba Sendiri" di bawah ini.
Definisi dan Penggunaan
Properti column-gap
menentukan celah antara kolom.
Catatan: Jika ada aturan kolom di antara kolom, itu akan muncul di tengah celah.
Nilai bawaan: | normal |
---|---|
Diwarisi: | tidak |
Animasi: | Ya. Baca tentang animasi |
Versi: kapan: | Modul Penyelarasan Kotak CSS Level 3 |
Sintaks JavaScript: | objek .style.columnGap="50px" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
column-gap (in Multiple Columns) | 50 | 10 | 52 | 10 | 37 |
column-gap (in Grid) | 66 | 16 | 61 | 12.1 | 53 |
column-gap (in Flexbox) | 84 | 84 | 63 | Not supported | 70 |
Sintaks CSS
column-gap: length|normal|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
length | A specified length that will set the gap between the columns | |
normal | Default value. Specifies a normal gap between the columns. W3C suggests a value of 1em | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Lebih Banyak Contoh
Contoh
Bagi teks dalam elemen <div> menjadi tiga kolom:
div
{
column-count: 3;
}
Contoh
Tentukan lebar, gaya, dan warna aturan antar kolom:
div
{
column-rule: 4px double #ff00ff;
}
Halaman Terkait
Tutorial CSS: Beberapa Kolom CSS
Tutorial CSS: Tata Letak Kotak CSS
Referensi CSS: Properti celah baris
Referensi CSS: Properti celah
Referensi DOM HTML: properti columnGap