<div id="padre">
  <img src="https://i.picsum.photos/id/0/600/400.jpg">
</div>
#padre {
  width: 300px;
  height: 300px;
}

#padre img {
  width: 100%;
  height:100%;
  object-fit: cover;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.