# CSS Grid doesn't work

**URL:** <https://forum.freecodecamp.org/t/css-grid-doesnt-work/388433>\
**Category:** I Built This\
**Created:** [May 13, 2020, 9:55pm UTC](https://forum.freecodecamp.org/t/css-grid-doesnt-work/388433 "2020-05-13T21:55:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Camoflasche](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camoflasche/32/135167_2.png) [@Camoflasche](https://forum.freecodecamp.org/u/Camoflasche)\
**Post date:** [May 13, 2020, 9:55pm UTC](https://forum.freecodecamp.org/t/css-grid-doesnt-work/388433/1 "2020-05-13T21:55:55Z")

</div>

I am working at my second project and I want to use the CSS Grid but that doesn’t work. I want that the 3 areas are at one row, when there is not enough space put them in extra rows. my [link](https://codepen.io/Camoflasche/pen/JjYBwKX?editors=1100)

---

<div class="post-metadata">

**Author:** ![germanbobadilla](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/germanbobadilla/32/152727_2.png) [@germanbobadilla](https://forum.freecodecamp.org/u/germanbobadilla)\
**Post date:** [May 13, 2020, 11:03pm UTC](https://forum.freecodecamp.org/t/css-grid-doesnt-work/388433/2 "2020-05-13T23:03:06Z")

</div>

Try this:

```auto
grid-template-columns: 1fr 200px;

```

Check out [this mdn website](https://developer.mozilla.org/en-US/docs/Web/CSS/grid) about grid.

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [May 14, 2020, 1:50am UTC](https://forum.freecodecamp.org/t/css-grid-doesnt-work/388433/3 "2020-05-14T01:50:07Z")

</div>

1. You didn’t close the `item2` div correctly.

2. You have an invalid value for the [grid-template-areas](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas).

3. You can use an “auto grid”, you do not need `grid-template-areas`.

```auto
main {
  display: grid;
  grid-gap: 5%;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  justify-items: center;
}

```

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 1:19pm UTC](https://forum.freecodecamp.org/t/css-grid-doesnt-work/388433/4 "2021-06-01T13:19:11Z")

</div>

Closed on June 1, 2021, 1:19pm UTC


