Answer the question
In order to leave comments, you need to log in
How to center images of any size vertically and horizontally in a row?
There is a grid with pictures in 4 columns. I'm struggling with how to center images on the vertical and horizontal center at any resolution, regardless of the size of the image (height). How to do this using only styles, not scripts and without using flex , because. Do you need ie9+ crossbrowser support ? Fiddle
<div class="row">
<div class="col-sm-3 col-xs-3">
<img src="http://placehold.it/70x81">
</div>
<div class="col-sm-3 col-xs-3">
<img src="http://placehold.it/100x33">
</div>
<div class="col-sm-3 col-xs-3">
<img src="http://placehold.it/100x19">
</div>
<div class="col-sm-3 col-xs-3">
<img src="http://placehold.it/80x72">
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question