<img src="https://images.unsplash.com/photo-1584772988869-dccc362700a6?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3634&q=80" alt="" class="exImg">
<img src="https://images.unsplash.com/photo-1584670747386-1e7424adab51?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2250&q=80" alt="" class="exImg2">
.exImg {
  width: 100px;
  height: 100px;
  background: lightgray;
  object-fit: cover;
}
.exImg2 {
  width: 100px;
  height: 100px;
  background: lightgray;
  object-fit: contain;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.