如何使SVG元素透明(使用SVGweb)

Mat*_*ias 6 internet-explorer svg transparency transparent fill

在SVG文档中,我想使 - <path>元素透明.我试过<path fill="transparent />"但是这给了我ie8的黑色表面(这是未知值的默认颜色).我使用SVGweb在ie8中显示SVG.如何让它在ie8中显得透明?

编辑:

根据SVG-SPEC(http://www.w3.org/TR/SVG/painting.html#SpecifyingPaint),该属性fill采用类型值<paint>.该值currentColor在ie8中起作用,但ff和chrome不支持它.

所以我想重塑一下我的问题:如何让它在ff,chrome和ie8中同时变得透明?

Phr*_*ogz 10

fill="none"
Run Code Online (Sandbox Code Playgroud)

或者您可以通过以下方式欺骗(并伤害表现):

fill-opacity="0"
Run Code Online (Sandbox Code Playgroud)

  • 只要你为'pointer-events'使用正确的值,两者都是"可以保持"的,参见http://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty. (3认同)