The grid-row-gap
sets the space between the grid rows.
It accepts any length value, such as, px
, %
, em
, and others.
The default is 0, meaning there is no gap between the rows.
A grid with a grid-row-gap
of 30-pixels.
<style>
.grid-container {
background-color: steelblue;
padding: 10px;
display: grid;
grid-column-gap: 10px;
grid-row-gap: 30px;
grid-template-columns: auto auto auto auto;
}
.grid-container > div {
background-color: aliceblue;
text-align: center;
padding: 15px 5px;
font-size: 18px;
}
</style>
<div class="grid-container">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
</div>
grid-row-gap: length;
Note: The grid-row-gap
property is synonymous with row-gap. They can be used interchangeably.
Value | Description |
---|---|
length |
Default is 0. Any valid CSS length value. |
This table shows when grid-row-gap
support started for each browser.
Chrome
|
57 | Mar 2017 |
Firefox
|
52 | Mar 2017 |
IE/Edge
|
16 | Sep 2017 |
Opera
|
44 | Mar 2017 |
Safari
|
10 | Sep 2016 |