In a scenario where you have two images placed in side by side columns, it is important to ensure proper responsive behavior across all devices with the help of some JS and CSS coding.
.imageBox{min-height:300px;}
<div class="row">
<div class="col-1">
<div class="imageBox">
<img src="xyz.jpg" alt=""/>
</div>
</div>
<div class="col-2">
<div class="imageBox">
<img src="xyz.jpg" alt=""/>
</div>
</div>
</div>
JavaScript:
$('.imageBox').children('img').each(function(n, img) {
var $img = $(img);
var $imgUrl = $(this).attr('src');
$img.parent('.imageBox').css({
'background': 'transparent url(' + $imgUrl + ') top center no-repeat',
'background-size': 'cover',
'-webkit-background-size': 'cover',
'-moz-background-size': 'cover',
'-o-background-size': 'cover'
});
$img.hide();
});