- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Named grid areas: the grid-template-areas property</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;
}
You’ve gone to a different page
Goalscompleted
0
- Assign the following grid structure for the
.land
block using thegrid-template-areas
property:"w w l l"
"w w l l"
"g g l l"
"r r r r"
- Assign the corresponding grid areas for the element grid using the
grid-area
property:
for.element--water
assign characterw
;
for.element--grass
assign characterg
;
for.element--lava
assign characterl
;
for.element--rocks
assign characterr
.
Comments