- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The grid-template-areas property and empty grid areas</title>
<link href="world.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body class="world">
<div class="land land--guided">
<div class="element element--water"></div>
<div class="element element--grass"></div>
<div class="element element--rocks"></div>
<div class="element element--lava"></div>
</div>
</body>
</html>
CSS
.land {
display: grid;
grid-template-areas:
"w w l l"
"w w l l"
"g g l l"
"r r r r";
}
.element--water {
grid-area: w;
}
.element--grass {
grid-area: g;
}
.element--lava {
grid-area: l;
}
.element--rocks {
grid-area: r;
}
You’ve gone to a different page
Goalscompleted
0
- Change the grid structure for the
.land
block to the following:"w w . ."
". . l l"
"g g . ."
". . r r"
Comments