crop image css

CSS
.img {
  object-fit: contain;
}.img {
	object-fit: cover;         
  	object-position: 100% 0;  //move image position in x direction. 
  	object-position: 0 100%; //move image position in y direction.
}
Source

Also in CSS: