overflow:hidden ignored with border-radius and CSS transforms (webkit only)

前端 未结 4 850
天命终不由人
天命终不由人 2020-12-04 22:25

I want to have a square image inside a circle.

When the user hovers over the image, the image should scale (zoom in).

The circle should remain the same size.

4条回答
  •  半阙折子戏
    2020-12-04 23:32

    You need to add this code to the parent of your img :

    position:relative;
    z-index:1;
    

    Example here : http://codepen.io/DavidN/pen/dIzJK

提交回复
热议问题