You can trim img as follows:
CSS
.crop-container { width: 200px; height: 300px; overflow: hidden; } .crop-container img { margin-top: -100px; margin-left: -200px; }
Adjust the height and width container to adjust the size of the cropped img and adjust the number of negative margin-top and margin-left in the img element itself to choose which part of the image to crop.
HTML:
<div class="crop-container"> <img src="some-img"/> </div>
Working script

EDIT: An alternative solution for a grid with two columns with fixed height rows:
CSS
body { margin: 0; } div.img { float: left; width: 49%; margin: 0.5%; height: 100%; background-size: cover!important; background-repeat: no-repeat!important; } div.row { height: 300px; }
HTML:
<div class='row'> <div class='img' style='background: url("some-image");'> </div> <div class='img' style='background: url("some-other-image");'> </div> </div> <div class='row'> <div class='img' style='background: url("foo-image");'> </div> <div class='img' style='background: url("bar-image");'> </div> </div>
Working script
nettux443
source share