2013-05-01 64 views
0

进出口使用IE 10在这里,火狐工作正常,但没有面具在IESVG图像掩盖了IE

显示
<svg style="height:0;"> 
             <mask id="m1" maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse"> 
             <image width="78px" height="78px" xlink:href="images/mask2.png"></image> 
             </mask> 
            </svg> 
            <img src="images/avatar-sample.jpg" style="mask:url(#m1);"/> 
+0

[SVG Image Mask在Firefox或IE中无法正常工作]的可能副本(http://stackoverflow.com/questions/16320863/svg-image-mask-not-working-in-firefox-or-ie) – cimmanon 2013-05-01 15:56:03

+0

漂亮类似的,但在一个面具适用于一个foreignObject和另一个HTML img元素。前者应该在IE中工作,但不能在后者中工作。 – 2013-05-01 15:59:36

+0

既不在工作。前者使用foreignObject在IE – Glen 2013-05-01 16:11:37

回答

0

仅限Firefox浏览器目前支持applying a mask directly to an HTML element。其他UA只允许您在SVG对象上设置SVG效果,如遮罩。

如果你想要在IE中工作,你将不得不使用SVG <image>元素来显示图像而不是HTML <img>元素。

+0

中显示完全空白的页面,所以有人对如何在FF和IE中进行这项工作有任何意见? – Glen 2013-05-01 16:27:02

+0

这是你的另一个问题。我已经回答了这个问题。 – 2013-05-01 19:35:45