I am looking to vertically align images with varying ratios, where the image may be larger or smaller than the content and also include padding;
I have tried different solutions found here, but none seem to cover all my requirements; I specifically need it to work in IE9 and IE10.
.thumb {
border: 2px solid #4FA738;
border-radius: 0.1875rem;
cursor: pointer;
display: inline-block;
font: 0/0 a;
margin: 0 0.5rem 0 0;
transition: 0.2s;
text-align: center;
}
.thumb img {
max-height: 100%;
max-width: 100%;
width: auto;
height: auto;
display: block;
vertical-align:middle;
margin:auto;
padding: 2px;
}
<div class="thumbs">
<div class="thumb" style="width:70px;height:70px;">
<img src="http://via.placeholder.com/350x150">
</div>
<div class="thumb" style="width:70px;height:70px;">
<img src="http://via.placeholder.com/200x100">
</div>
<div class="thumb" style="width:70px;height:70px;">
<img src="http://via.placeholder.com/140x100">
</div>
<div class="thumb" style="width:70px;height:70px;">
<img src="http://via.placeholder.com/50x50">
</div>
<div class="thumb" style="width:70px;height:70px;">
<img src="http://via.placeholder.com/150x450">
</div>
</div>