本文介绍了如何使SVG元素透明(使用SVGweb)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In a SVG document, I want to make a <path>-element transparent. I tried <path fill="transparent />" but this gives me a black surface in ie8 (which is the default color for unknown values). I use SVGweb to display the SVG in ie8. How do I make it appear transparent in ie8?

根据SVG-SPEC( http://www.w3.org/TR/SVG/painting.html#SpecifyingPaint ),属性fill的类型值为<paint>.值currentColor在ie8中可以使用,但是ff和chrome不支持.

According to the SVG-SPEC ( http://www.w3.org/TR/SVG/painting.html#SpecifyingPaint ), the attribute fill takes a value of type <paint>. the value currentColor does work in ie8, yet it's not supported by ff and chrome.

所以我想重提我的问题:如何使其在ff,chrome和ie8中同时显示透明?

So I'd like to reshape my question:How do I make it appear transparent in ff, chrome and ie8 simultaneously?

推荐答案

fill="none"

或者您可以使用以下方法作弊(并损害性能):

Or you can cheat (and hurt performance) with:

fill-opacity="0"

这篇关于如何使SVG元素透明(使用SVGweb)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 13:52
查看更多