I have an image gallery that is overflowing its containing div. I have tried various solutions to no avail. What CSS code approach will fit the grid to the fixed-height outer div, including making each image with caption automatically resize/scale to fit proportionally?
What I’ve Tried
The basic approach I tried was this:
- Set a fixed height on container div
- Set the direct children of the container div to height: 100%, so that it will automatically fill the available space
Additionally, I’ve tried setting height and width on various levels of nested content items to no avail. I’m not sure what I’m missing.
Here is a link to the live staging site: http://elijahlisttv.org/home-3/
2
Answers
Well, I didn't find the answer to this exact/specific question, but I did discover the answer to the problem I was trying to solve. Having played around with the CSS a bit more, it looks like the root issue is I can't seem to remove the spacing between the the rows on the right. I've tried removing margin, padding, and ensuring there was no "gap" property of any kind. No love.
SOLUTION: Drag column widths until the Elementor posts grid widget in the right column looks even with the image in the left column.
Still taking answers for how to do this with CSS.
Elementor generates terrible code 😞.
Below I provide one of the options for implementation 👇.