Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How to pass level 16 lesson 7

<!DOCTYPE html>
<html>
<head>
<title>CSS Grid Template Areas</title>
<style>
.grid {
display: grid;
background-color: #d6d1f5;
padding: 20px;
grid-template-columns:50px 50px 50px 50px;
grid-template-rows:auto;
grid-template-areas:"thor thor . . "" . asgard asgard . "" . . loki loki";

}
.item {
background-color: #E7E4F8;
border: 1px solid black;
padding: 20px;
text-align: center;
}
.thor {
background-color: #ED639E;
grid-area: thor;
}
.loki {
background-color: #FFB643;
grid-area: loki;
}
.asgard {
background-color: #4535AA;
color: white;
grid-area: asgard;
}

</style>
</head>
<body>
<div class="grid">
<div class="item asgard">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item thor">4</div>
<div class="item">5</div>
<div class="item">6</div>
<div class="item loki">7</div>
<div class="item">8</div>
<div class="item">9</div>
</div>
</body>
</html>


i am getting the correct output but its telling me to use grid-template-areas property to define the first row for thors column.
by

2 Answers

Abhishekrlwte
In .grid add
"thor thor . . "
". asgard asgard ."
". . loki loki"
Add above code in .grid thats it.
Ashutoshry6u3
if not accepted then remove thors line and write again . It's work for me !! that's strange
.grid {
display: grid;
background-color: #d6d1f5;
padding: 20px;
grid-template-areas:
"thor thor . ."
". asgard asgard ."
". . loki loki";

}

Login / Signup to Answer the Question.