Having trouble figuring out how to fill containers with images? I've encountered an issue.
If the images are too short, they need to be full height, but they can overflow the sides. If the images are too narrow, they should be full width, but they might overflow at the bottom.
https://i.sstatic.net/Biuz1.png
<div class="cb-img-fw four-image">
<a href="postURL"><img src="imageURL"></a>
</div>
Here is the current CSS:
.four-grid-post > .four-image{
max-height: 184px;
max-width: 271px;
overflow: hidden;
}
.four-grid-post > .four-image img{
min-width: 100%;
max-width: 100%;
height: auto;
}
I'm considering jQuery solutions as well, but since my content loads with ajax, it could potentially create some issues.