Please see this minimum example:
div {
position: relative;
width: 128px;
height: 128px;
border: 1px solid red;
}
img {
position: absolute;
inset: 0;
}
<div>
<img src="https://source.unsplash.com/weekly?coffee">
</div>
I thought the image should fill the entire parent box, but the image is overflow, why is this happening?