According to the information provided by w3schools.
The background image will be resized to cover the entire container, even if it means stretching the image or cutting off some edges.
This indicates that the image will fill the div completely without leaving any edges behind, and it will adjust 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>
In the snippet above,
The first item has a background-size: cover
property;
Which ensures that either the width or height will fill 100% of the container without any space left unused, maintaining the original resolution ratio of the image.
The second item has a background-size: contain
property;
Which guarantees that either the height or width will occupy 100% of the container with no overflow, resulting in empty space within the container while preserving the original image resolution ratio.
The third item has a background-size: 100% 100%
property;
This setting ensures both width and height are at 100%, filling the container entirely without any space leftover or overflow, but it does not maintain the original resolution ratio of the image.
I hope this explanation clarifies any uncertainties you may have.