SVG填充颜色透明度/ alpha? [英] SVG fill color transparency / alpha?

查看:162
本文介绍了SVG填充颜色透明度/ alpha?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在SVG填充颜色上设置透明度或Alpha水平?

Is it possible to set a transparency or alpha level on SVG fill colours?

我已经尝试向填充标记添加两个值#044B94to 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"/>

此外,还有以下内容:


  • stroke-opacity 笔触属性

  • opacity 为整个对象

  • stroke-opacity attribute for the stroke
  • opacity for the entire object

这篇关于SVG填充颜色透明度/ alpha?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆