My images are displayed in a horizontal line, but some have different sizes. I want to center all the images within their container div for a better look. Is there a way to do this automatically with CSS so that the images remain centered regardless of size changes?
You can check out an example here.
<div class="row" style="text-align: center; margin: 30px 0; width: 100%;">
<div class="col-xs-12 col-sm-4 col-md-2" style="margin: 15px 0; text-align: center; display: inline-block; vertical-align: middle;">
<a href="http://example.com/" target="_blank"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOAAAADgCAMAAAAt85rTAAAAQlBMVEX0TiT/uQIBpO+BuQD////0SRz/tAD5/v/2d17//PRStvIAou/7/PR2tACbx1L//vkAne7/rwBAsfH0RRGUw0D4lIKWmv8+AAABF0lEQVR4nO3P2Q3CQBQEwQVsY+47/1T5gw0ADXpWdQKtai3VOA+fjqdNqpgPEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBDwl8Ax1eNPwDnWqwM+z6nasPAAqwdYPc...
(...Cont'd...) </div>
</div>