I have a CSS-Grid with two columns. Inside this columns i need to place item elements one after another. Now i have a problem that inside the grid the elements are always arranged in rows which means there are sometimes big gaps between elements inside a column. How can i change to grid so that there are just the normal margin gaps between two elements inside a column.
.grid-wrapper {
display: grid;
grid-template-columns: 1fr 1fr;
grid-column-gap: 5vw;
}
.grid-item {
background-color: red;
margin-bottom: 5vw;
}
.grid-item:nth-child(1) {
height: 20vw;
}
.grid-item:nth-child(2) {
height: 30vw;
}
.grid-item:nth-child(3) {
height: 10vw;
}
.grid-item:nth-child(4) {
height: 40vw;
}
<div class="grid-wrapper">
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
</div>