2010-10-28 45 views
0

这是一个已知的bug,-moz-border-radius在firefox中的图像上不起作用。什么是获取此功能的方法,而不是将图像作为背景放在圆角的div上?firefox img圆边框而不使用div背景

+0

看起来这是固定在Firefox 4 – kennytm 2010-10-28 19:44:22

+0

并不意味着没有人会使用FF3了= [ – 2010-10-28 19:45:38

+0

我想你必须把它放在某种容器中。看到这个答案:http://stackoverflow.com/questions/1347796/firefox-moz-border-radius-wont-crop-out-image – bogeymin 2010-10-28 19:46:28

回答

1

在当前的Firefox you can use SVG filters。有一个SVG文件clip.svg这样的:

<svg:svg height="0"> 
    <svg:clipPath id="c1" clipPathUnits="objectBoundingBox"> 
     <svg:rect x="0" y="0" rx="0.05" ry="0.05" width="1" height="1"/> 
    </svg:clipPath> 
</svg:svg> 

而且在CSS应用它是这样的:

.target { clip-path: url(clip.svg#c1); }