Properti jumlah kolom CSS
Contoh
Bagi teks dalam elemen <div> menjadi tiga kolom:
div
{
column-count: 3;
}
Lebih banyak contoh "Coba Sendiri" di bawah ini.
Definisi dan Penggunaan
Properti column-count
menentukan jumlah kolom yang harus dibagi menjadi elemen.
Nilai bawaan: | mobil |
---|---|
Diwarisi: | tidak |
Animasi: | Ya. Baca tentang animasi |
Versi: kapan: | CSS3 |
Sintaks JavaScript: | objek .style.columnCount = "3" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Angka yang diikuti oleh -webkit- atau -moz- menentukan versi pertama yang berfungsi dengan awalan.
Property | |||||
---|---|---|---|---|---|
column-count | 50.0 4.0 -webkit- |
10.0 | 52.0 2.0 -moz- |
9.0 3.1 -webkit- |
37.0 15.0 -webkit 11.1 |
Sintaks CSS
column-count: number|auto|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
number | The optimal number of columns into which the content of the element will be flowed | |
auto | Default value. The number of columns will be determined by other properties, like e.g. "column-width" | |
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
Tentukan celah 40 piksel di antara kolom:
div
{
column-gap: 40px;
}
Contoh
Tentukan lebar, gaya, dan warna aturan antar kolom:
div
{
column-rule: 4px double #ff00ff;
}
Halaman Terkait
Tutorial CSS: Beberapa Kolom CSS
Referensi HTML DOM: properti columnCount