How do I prevent an image from overflowing a rounded corner box?

前端 未结 10 804
盖世英雄少女心
盖世英雄少女心 2020-12-03 09:50

If I use this code, the image isn\'t clipped by the div\'s rounded corners (resulting in the image\'s square corners covering up the div\'s rounded ones):

&l         


        
10条回答
  •  渐次进展
    2020-12-03 10:20

    I think this problem occurs when the image or the image's parent is position:absolute. This is understandable as setting absolute takes the element out of the flow of the document.

    I'm 90% sure I've seen a fix for this, I'll update this post when I do:D

提交回复
热议问题