- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Combining automatic and explicit coordinates, part 2</title>
<link href="world.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body class="world">
<div class="land land--small">
<div class="element element--water element--simple">1</div>
<div class="element element--grass element--simple">2</div>
<div class="element element--rocks element--simple">3</div>
<div class="element element--lava element--simple">4</div>
<div class="element element--sand element--simple">5</div>
</div>
</body>
</html>
CSS
.land {
display: grid;
grid-template-columns: 100px 100px 100px;
grid-template-rows: 100px 100px 100px;
}
You’ve gone to a different page
Goalscompleted
0
- Assign the grid item coordinates for column grid lines
1
to4
for the.element-water
block. - Assign the coordinates for row lines
2
to4
for the.element--grass
block. - And assign the column lines from
2
to4
for the.element--sand
block.
Comments