CSS Background Size

The background-size property controls the size of background images.

Preview

Code

<style>
.box{
background-image:url(https://picsum.photos/500/300);
background-size:cover;
height:200px;
}
</style>

<div class="box"></div>

More CSS Backgrounds Examples (7)