Divide grid into an area template

Tell us what’s happening:

grid-template-areas:
  "header header header"
  "advert content content"
  "footer footer footer";

The code above merges the top three cells together into an area named header , the bottom three cells into a footer area, and it makes two areas in the middle row; advert and content .

I didn’t understand the meaning of this example.Can i get some help understanding?

Your code so far


<style>
.item1{background:LightSkyBlue;}
.item2{background:LightSalmon;}
.item3{background:PaleTurquoise;}
.item4{background:LightPink;}
.item5{background:PaleGreen;}

.container {
  font-size: 40px;
  min-height: 300px;
  width: 100%;
  background: LightGray;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  grid-gap: 10px;
  grid-template-areas:
  /* Only change code below this line */
    "header header header"
    ". content content"
    "footer footer footer";
  /* Only change code above this line */
}
</style>

<div class="container">
<div class="item1">1</div>
<div class="item2">2</div>
<div class="item3">3</div>
<div class="item4">4</div>
<div class="item5">5</div>
</div>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36.

Challenge: Divide the Grid Into an Area Template

Link to the challenge:

As you’ve stated grid-template-areas merges cells in the grid you create in a way that helps you create a layout for your web page. It will make more sense when you progress to the next exercise Place Items in Grid Areas Using the grid-area Property

Also, check out this link below. It provides much better illustrations to see how using the grid-template-areas property can change the look of a page.