【问题标题】:How to make an SVG element transparent (using SVGweb)如何使 SVG 元素透明(使用 SVGweb)
【发布时间】:2011-12-24 16:16:23
【问题描述】:

在 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中同时显示为透明?

【问题讨论】:

    标签: internet-explorer svg transparency transparent fill


    【解决方案1】:
    fill="none"
    

    或者您可以通过以下方式作弊(并损害性能):

    fill-opacity="0"
    

    【讨论】:

    • 好吧,fill="transparent"fill="none" 不同(首先是 :hover-able)。 fill-opacity="0" 为我工作。
    • 只要您为“指针事件”使用正确的值,两者都是“可悬停的”,请参阅w3.org/TR/SVG11/interact.html#PointerEventsProperty
    猜你喜欢
    • 2019-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-23
    相关资源
    最近更新 更多