I am trying to make something like a gallery, take a look for this grid system from materializecss themes:
-I want to make 3 Columns all the same width so: grid-template-columns: repeat(3, 1fr);
-and a gap between the columns so: column-gap: 1em;
and I have a divs inside, I want to make the div take it's own height and NOT to make all of the divs has the same height.
enter image description herelook at this:
code:
<div class="puzzles_grid">
<!--card1-->
<div class="theblock">
<div>
<img class="puzzles_img" src="https://picsum.photos/200/100" alt="">
</div>
<div>
prices 100$
</div>
</div>
<!--card2-->
<div class="theblock">
<div>
<img class="puzzles_img" src="https://picsum.photos/400/400" alt="">
</div>
<div>
prices 100$
</div>
</div>
<!--card3-->
<div class="theblock">
<div>
<img class="puzzles_img" src="https://picsum.photos/300/700" alt="">
</div>
<div>
prices 100$
</div>
</div>
<!--card4-->
<div class="theblock">
<div>
<img class="puzzles_img" src="https://picsum.photos/700/700" alt="">
</div>
<div>
prices 100$
</div>
</div>
</div>
<style>
.puzzles_grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
column-gap: 1em;
grid-row-gap: 1em;
}
.theblock {
background-color: #E91E63;
width: 100%;
}
</style>