Using grid-column

can anyone explain this whole starting and ending concept,I watched the video but not getting it.


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

.item5 {
  background: PaleGreen;
  /* Only change code below this line */
  grid-column: 1/3;

  /* Only change code above this line */
}

.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;
}
</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.123 Safari/537.36.

Challenge: Use grid-column to Control Spacing

Link to the challenge:

ok so,

You have a container, with it’s style, that will envolved all the items.

so you first call container that has 3 colums and three rows, and then inside the container you call all the items, every item has a color to identify it.

your item five will be longer, because “grid-column: 1/3;” says that the item five starts in colum 1 and ends in colum 2 (not in three).

1 Like

but as item 5 is the last one to call, it is going to be at the bottom of the grid (container)
when a container has rows and columns, it is call a “grid”

1 Like

before grid, you can learn about flex box.
this article is excellent, and it helped me a lot.

it is not large.

1 Like

my first solution !!! :upside_down_face: