0

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?

Joseph
  • 3,974
  • 7
  • 34
  • 67

0 Answers0