SVG 填充颜色透明度/alpha? [英] SVG fill color transparency / alpha?
本文介绍了SVG 填充颜色透明度/alpha?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在 SVG 填充颜色上设置透明度或 alpha 级别?
Is it possible to set a transparency or alpha level on SVG fill colours?
我尝试向填充标记添加两个值(将其从 fill="#044B94"
更改为 fill="#044B9466"
),但这并没有不行.
I've tried adding two values to the fill tag (changing it from fill="#044B94"
to fill="#044B9466"
), but this doesn't work.
推荐答案
您使用了附加属性;fill-opacity
:该属性取0.0到1.0之间的十进制数,含;其中 0.0 是完全透明的.
You use an addtional attribute; fill-opacity
: This attribute takes a decimal number between 0.0 and 1.0, inclusive; where 0.0 is completely transparent.
例如:
<rect ... fill="#044B94" fill-opacity="0.4"/>
此外,您还有以下内容:
Additionally you have the following:
stroke-opacity
描边属性opacity
整个对象
stroke-opacity
attribute for the strokeopacity
for the entire object
这篇关于SVG 填充颜色透明度/alpha?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文