Grid area in CSS grid

hey

any idea why cell number 4 disappeared when i try to place it in the footer?

also, why cell number 5 takes the entire width?

<style>
  .item1{background:LightSkyBlue;}
  .item2{background:LightSalmon;}
  .item3{background:PaleTurquoise;}
  .item4{background:LightPink; grid-area: footer;}
  
  .item5 {
    background: PaleGreen;
    /* add your code below this line */
    
    grid-area: footer;
    
  }
  
  .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: 
      "header header header"
      "advert content content"
      "footer footer footer";
  }
</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>

1 Like

Hey Tomer,
Can you post the challenge link?

1 Like

hey @aditya_p

try to place the grid-area on item 4

https://learn.freecodecamp.org/responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property/

1 Like

You need to remove grid area from item-4 and you should be good to go.
Hope it helps.

1 Like

hey @aditya_p

that was my purpose , to place item4 in the footer

1 Like

The item4 is under the item5 because both are in the footer right now

hey @Michael55555

why they don’t share the space? each take the entire row space instead of just on cell in the footer

1 Like

You cannot give same grid:area property to two elements.

1 Like

@tomer-n, aditya_p is right

thanks man, that’s the thing

1 Like