Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: explicitly-placed grid items honor gutters in position and size</title>
<link rel="match" href="grid-gutters-explicit-placement-ref.html">
<link rel="author" title="Yulun Wu" href="mailto:yulun_wu@apple.com">
<meta name="assert" content="Grid items placed with explicit grid-row and grid-column lines are offset and sized to account for the row-gap and column-gap between the lines they span.">
<style>
#grid {
display: grid;
width: 310px;
gap: 20px;
grid-template-columns: 90px 90px 90px;
grid-template-rows: 90px 90px 90px;
background-color: green;
}
#grid > div {
background-color: blue;
}
</style>
<p>The test passes if it has the same visual effect as reference.</p>
<div id="grid">
<div style="grid-row: 1 / 2; grid-column: 1 / 2;"></div>
<div style="grid-row: 1 / 2; grid-column: 2 / 3;"></div>
<div style="grid-row: 1 / 2; grid-column: 3 / 4;"></div>
<div style="grid-row: 2 / 3; grid-column: 1 / 2;"></div>
<div style="grid-row: 2 / 3; grid-column: 2 / 3;"></div>
<div style="grid-row: 2 / 3; grid-column: 3 / 4;"></div>
<div style="grid-row: 3 / 4; grid-column: 1 / 2;"></div>
<div style="grid-row: 3 / 4; grid-column: 2 / 3;"></div>
<div style="grid-row: 3 / 4; grid-column: 3 / 4;"></div>
</div>