Rounding the sides of a big image contained in a small division not working in Chrome

前端 未结 3 656
有刺的猬
有刺的猬 2021-01-21 11:14

I am trying to rounding the sides of a background image with border-radius property.

Here is my scenario:

I placed a big image in a small division a

3条回答
  •  悲&欢浪女
    2021-01-21 12:00

    This appears to be a Chrome bug and you should consider raising it as such @ http://code.google.com/p/chromium/issues/list

    For now, you can "work around it" by changing position: relative to position: static

    A Hacky Fix

    As answered here, you can add a -webkit-mask-image to the parent element to hide the overflowing content:

    .video_thumb {
        -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
    }
    

提交回复
热议问题