CSS grid-template-rows Proprietà
Esempio
Specificare la dimensione della riga (altezza):
.grid-container {
display: grid;
grid-template-rows:
100px 300px;
}
Definizione e utilizzo
La grid-template-rows
proprietà specifica il numero (e le altezze) delle righe in un layout a griglia.
I valori sono un elenco separato da spazi, in cui ogni valore specifica l'altezza della rispettiva riga.
Valore di default: | nessuno |
---|---|
Ereditato: | no |
Animabile: | sì. Leggi su animabile |
Versione: | Modulo layout griglia CSS Livello 1 |
sintassi JavaScript: | oggetto .style.gridTemplateRows="50px 200px" |
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente la proprietà.
Property | |||||
---|---|---|---|---|---|
grid-template-rows | 57 | 16 | 52 | 10 | 44 |
Sintassi CSS
grid-template-rows: none|auto|max-content|min-content|length|initial|inherit;
Valori di proprietà
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 |
Pagine correlate
Esercitazione CSS: layout della griglia CSS
Riferimento CSS: la proprietà grid-colonne
Riferimento CSS: la proprietà del modello di griglia