2012-04-07 157 views
0

SVG重写我有此SVG:与透明度

<circle cx="50" cy="100" r="50" stroke-width="0" fill="orange"/> 
<polygon points="0,100, 50,50 100,100" fill="white"/> 

背景是透明的。多边形覆盖白色圆圈,但我希望这个区域是透明的(而不是白色)。我怎样才能做到这一点?

+0

有人吗?请帮忙! – balping 2012-04-07 20:35:49

回答

2

可以使用fill-rule: evenodd属性与path:s到 “开洞” 给你的形状:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1"> 
<path fill="orange" 
     fill-rule="evenodd" 
     d="M50 50 L100 100 L0 100 
     A50 50 0 0 1 100 100 
     A50 50 0 0 1 0 100 z"/> 
</svg> 
+0

另请参阅:http://stackoverflow.com/questions/1983256/how-can-i-cut-one-shape-from-another – mizo 2012-04-07 21:21:48

+0

非常感谢! – balping 2012-04-07 21:38:48