Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Reference: a 3x3 grid of blue squares on a green background</title>
<link rel="author" title="Yulun Wu" href="mailto:yulun_wu@apple.com">
<style>
#grid {
width: 310px;
height: 310px;
background-color: green;
position: relative;
}
#grid > div {
background-color: blue;
width: 90px;
height: 90px;
position: absolute;
}
#grid :nth-child(1) { top: 0; left: 0; }
#grid :nth-child(2) { top: 0; left: 110px; }
#grid :nth-child(3) { top: 0; left: 220px; }
#grid :nth-child(4) { top: 110px; left: 0; }
#grid :nth-child(5) { top: 110px; left: 110px; }
#grid :nth-child(6) { top: 110px; left: 220px; }
#grid :nth-child(7) { top: 220px; left: 0; }
#grid :nth-child(8) { top: 220px; left: 110px; }
#grid :nth-child(9) { top: 220px; left: 220px; }
</style>
<p>The test passes if it has the same visual effect as reference.</p>
<div id="grid">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>