Properti baris-templat-grid CSS
Contoh
Tentukan ukuran baris (tinggi):
.grid-container {
display: grid;
grid-template-rows:
100px 300px;
}
Definisi dan Penggunaan
Properti grid-template-rows
menentukan jumlah (dan tinggi) baris dalam tata letak kisi.
Nilai adalah daftar yang dipisahkan spasi, di mana setiap nilai menentukan tinggi baris masing-masing.
Nilai bawaan: | tidak ada |
---|---|
Diwarisi: | tidak |
Animasi: | Ya. Baca tentang animasi |
Versi: kapan: | Modul Tata Letak Grid CSS Level 1 |
Sintaks JavaScript: | objek .style.gridTemplateRows="50px 200px" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
grid-template-rows | 57 | 16 | 52 | 10 | 44 |
Sintaks CSS
grid-template-rows: none|auto|max-content|min-content|length|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
none | No size is set. Rows are created if needed | |
auto | The size of the rows is determined by the size of the container, and on the size of the content of the items in the row | |
max-content | Sets the size of each row to depend on the largest item in the row | |
min-content | Sets the size of each row to depend on the smallest item in the row | |
length | Sets the size of the rows, by using a legal length value. Read about length units |
Halaman Terkait
Tutorial CSS: Tata Letak Kotak CSS
Referensi CSS: Properti grid -columns
Referensi CSS: Properti template-grid