<div class="blaock"></div>
<img src="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" alt="MDN Logo" class="fill"/>
.fill{
width:100px;
height:100px;
object-fit: cover;
}
.blaock{
background-image:url(https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png);
width:100px;
height:100px;
background-size: cover;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.