CSSgrid -template-rowsプロパティ
例
行サイズ(高さ)を指定します。
.grid-container {
display: grid;
grid-template-rows:
100px 300px;
}
定義と使用法
このgrid-template-rows
プロパティは、グリッドレイアウトの行の数(および高さ)を指定します。
値はスペースで区切られたリストであり、各値はそれぞれの行の高さを指定します。
デフォルト値: | なし |
---|---|
遺伝性の: | いいえ |
アニメート可能: | はい。アニメート可能について読む |
バージョン: | CSSグリッドレイアウトモジュールレベル1 |
JavaScript構文: | object .style.gridTemplateRows = "50px 200px" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
grid-template-rows | 57 | 16 | 52 | 10 | 44 |
CSS構文
grid-template-rows: none|auto|max-content|min-content|length|initial|inherit;
プロパティ値
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 |
関連ページ
CSSチュートリアル:CSSグリッドレイアウト
CSSリファレンス:grid-columnsプロパティ
CSSリファレンス:grid-templateプロパティ