i have this HTML
<div class="container--1">
<div class="el el--1">(1) HTML</div>
<div class="el el--2">(2) and</div>
<div class="el el--3">(3) CSS</div>
<div class="el el--4">(4) are</div>
<div class="el el--5">(5) amazing</div>
<div class="el el--6">(6) languages</div>
<div class="el el--7">(7) to</div>
<div class="el el--8">(8) learn</div>
</div>
AND CSS
.el--1 {
background-color: blueviolet;
}
.el--2 {
background-color: orangered;
}
.el--3 {
background-color: green;
}
.el--4 {
background-color: goldenrod;
height: 150px;
}
.el--5 {
background-color: palevioletred;
}
.el--6 {
background-color: steelblue;
}
.el--7 {
background-color: yellow;
}
.el--8 {
background-color: crimson;
}
.container--1 {
font-family: sans-serif;
background-color: #ddd;
font-size: 40px;
margin: 40px;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: 1fr 1fr;
}
SO HAVE TWO ROWS with 4 columns. My fourth grid-items has explicit height of 150px. So the grid-items that are on the first grid rows are having also height of 150px because they are sharing the height of the 'heights grid-item`. But why the grid-items inside my second row are having height of 150px. Element number 5,6,7,8 has auto heights of 0px, Why they share the height from the first row ?