Plz help with grid css

I cannot figure this out! plz help.

I need to make header and footer take up the top and bottom rows and I can’t figure out how to do it.

  .item1 {
    background: LightSkyBlue;
    grid-area: header;
  .item2 {
    background: LightSalmon;
    grid-area: advert;
  .item3 {
    background: PaleTurquoise;
    grid-area: content;
  .item4 {
    background: lightpink;
    grid-area: footer;
  .container {
    font-size: 1.5em;
    min-height: 300px;
    width: 100%;
    background: LightGray;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 50px auto 1fr auto;
    grid-gap: 10px;
  @media (min-width: 300px){
      grid-template-columns: auto 1fr;
      grid-template-rows: auto 1fr auto;
        "advert header"
        "advert content"
        "advert footer";
  @media (min-width: 400px){
      /* change the code below this line */
      grid-template-columns: 150px auto 150px;
        "header header"
        "advert content"
        "footer footer";
    /* change the code above this line */
<div class="container">
  <div class="item1">header</div>
  <div class="item2">advert</div>
  <div class="item3">content</div>
  <div class="item4">footer</div>

This might be a better fit for the HTML / CSS forum.

But since you’re here…
You are changing the wrong css property. Look at the two other media queries for an example.

I did look at the other media query for an example, but I still cannot figure it out.

Each one of the CSS properties is a key-value pair separated by a colon. You have put the value for your template area but there is no key