I have the following grid of thumbnails (links to other pages) and I'm displaying them using a flexbox.
As you can see on the left since one of the images doesn't have the same aspect ratio, it doesn't fit correctly. I want it to fill that whole available space (essentially scale so it fills it and "crop" the overflow.)
The container css is this
display: flex;
flex-direction: row;
flex-wrap: wrap;
And each element has
flex-basis: 20%;
What css can I add to get the behavior I want?
In case it's relevant I'm actually doing this in React where the elements are loaded dynamically, and the css is actually a CSSProperties
object, but on the client side it's just rendered as normal css so I believe any css-based solution will still work. Thanks!