Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用透明覆盖SVG_Svg_Transparency - Fatal编程技术网

用透明覆盖SVG

用透明覆盖SVG,svg,transparency,Svg,Transparency,我有一个svg: <circle cx="50" cy="100" r="50" stroke-width="0" fill="orange"/> <polygon points="0,100, 50,50 100,100" fill="white"/> 背景是透明的。多边形用白色覆盖圆形,但我希望该区域是透明的(而不是白色)。如何执行此操作?您可以将属性与路径一起使用:s对形状进行“切割孔”: <svg xmlns="http://www.w3.org/2

我有一个svg:

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

背景是透明的。多边形用白色覆盖圆形,但我希望该区域是透明的(而不是白色)。如何执行此操作?

您可以将属性与
路径一起使用
: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>

另请参见: