Vlastnost CSS grid-template-rows
Příklad
Zadejte velikost řádku (výšku):
.grid-container {
display: grid;
grid-template-rows:
100px 300px;
}
Definice a použití
Vlastnost grid-template-rows
určuje počet (a výšky) řádků v rozložení mřížky.
Hodnoty jsou seznamem odděleným mezerami, kde každá hodnota určuje výšku příslušného řádku.
Výchozí hodnota: | žádný |
---|---|
Zděděno: | Ne |
Animovatelné: | Ano. Přečtěte si o tématu Animable |
Verze: | Modul rozložení mřížky CSS, úroveň 1 |
Syntaxe JavaScriptu: | objekt .style.gridTemplateRows="50px 200px" |
Podpora prohlížeče
Čísla v tabulce určují první verzi prohlížeče, která plně podporuje vlastnost.
Property | |||||
---|---|---|---|---|---|
grid-template-rows | 57 | 16 | 52 | 10 | 44 |
Syntaxe CSS
grid-template-rows: none|auto|max-content|min-content|length|initial|inherit;
Hodnoty vlastností
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 |
Související stránky
Kurz CSS: Rozvržení mřížky CSS
CSS Reference: Vlastnost grid -columns
CSS Reference: Vlastnost grid -template