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

前端 未结 10 807
盖世英雄少女心
盖世英雄少女心 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条回答
  •  萌比男神i
    2020-12-03 10:02

    If you make the image a background image instead of contents, the image won't clip the rounded corners (at least in FF3).

    You could also add a padding to the div, or margin for the image to add extra padding between the rounded border and the image.

提交回复
热议问题