Image bleeding through absolute positioned element when parent has border radius

Viewed 23

I have a parent div with a border radius set to overflow: hidden. The image beneath respects the radius somewhat. When I add an absolutely positioned element on top, the image bleeds through at the border. I've tried wrapping the image in another div but it didn't help.

bleeding image

jsbin is here bin

*{


 box-sizing: border-box;
  background: white;
}
.parent{
  border-radius: 16px;
  overflow: hidden;
  width: 200px;
  background: white;
  position: relative;
}

img{
  object-fit: cover;
  display: block;
  z-index: 1;
  overflow: auto;
}

.absolute{
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  background: white;
  padding: 10px;
  z-index: 99;
}
0 Answers
Related