Properti kolom-kolom otomatis CSS
Contoh
Tetapkan ukuran default untuk kolom dalam kisi:
.grid-container {
display: grid;
grid-auto-columns: 50px;
}
Definisi dan Penggunaan
Properti grid-auto-columns
menetapkan ukuran untuk kolom dalam wadah kisi.
Properti ini hanya memengaruhi kolom dengan ukuran yang tidak disetel.
Nilai bawaan: | mobil |
---|---|
Diwarisi: | tidak |
Animasi: | Ya. Baca tentang animasi |
Versi: kapan: | Modul Tata Letak Grid CSS Level 1 |
Sintaks JavaScript: | objek .style.gridAutoColumns="120px" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
grid-auto-columns | 57 | 16 | 52 | 10 | 44 |
Sintaks CSS
grid-auto-columns: auto|max-content|min-content|length;
Nilai properti
Value | Description | Play it |
---|---|---|
auto | Default value. The size of the columns is determined by the size of the container | |
fit-content() | ||
max-content | Sets the size of each column depending on the largest item in the column | |
min-content | Sets the size of each column depending on the smallest item in the column | |
minmax(min.max) | Sets a size range greater than or equal to min and less than or equal to max | |
length | Sets the size of the columns, by using a legal length value. Read about length units | |
% | Sets the size of the columns, by using a percent value |
Halaman Terkait
Tutorial CSS: Tata Letak Kotak CSS
Referensi CSS: Properti grid-auto- rows