Here's the current image I have displayed:
https://i.sstatic.net/qKH8x.jpg
This image is being styled by the following code:
.gallery-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
}
I've been searching for a solution to make each element only take up its necessary space rather than the height of the tallest image. I attempted setting grid-auto-rows
to auto
, but that didn't work.
If there's an alternative method other than using grid
, I am open to it. I experimented with flexbox
and adjusting the flex-basis
, but couldn't get it to function correctly.