As per the w3schools documentation.
Resize the background image to cover the entire container, even if it has to stretch the image or cut a little bit off one of the edges
It means the image will be spread in the div in a way that no edges will be left behind. And it will shrink based on the window size.
.item {
display: inline-block;
height: 200px;
width: 200px;
background-image: url('https://assets.dragoart.com/images/11939_501/how-to-draw-iron-man-easy_5e4c9ed9b16b58.14188289_53732_3_3.png');
}
.item1 {
background-size: cover;
}
.item2 {
background-size: contain;
}
.item3 {
background-size: 100% 100%;
}
<div class="item item1">
</div>
<div class="item item2">
</div>
<div class="item item3">
</div>
As you can see in the above snippet,
First item is background-size: cover;
Which means either width or height will be 100% in a way that there won't be any space left behind in the container even the other value overflows. This will keep the images original ratio of resolution.
Second item is background-size: contain;
Which means either height or width will be 100% in a way that, there won't be overflow, instead there will be space left behind in the container. This will keep the images original ratio of resolution.
Third item is background-size: 100% 100%;
Which means the width and height will be 100% in a way that there won't be any space left behind and there won't be any overflow. This will not keep the images original ratio of resolution.
Hope this would clarify your doubt.