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 Wang
  • 2,870
  • 6
  • 18
  • 44

0 Answers0