SVG fills color / alpha transparency?

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

I tried adding two values ​​to the fill tag (changing it from fill = "# 044B94" to fill = "# 044B9466"), but that will not work.

+314
source share
3 answers

You are using an optional attribute; fill-opacity: this attribute accepts a decimal number from 0.0 to 1.0 inclusive; where 0.0 is completely transparent.

For example:

<rect ... fill="#044B94" fill-opacity="0.4"/>

In addition, you have the following:

  • stroke-opacity bar attribute
  • opacity for the whole facility
+491
source

( CSS3) , , fill="rgba(124,240,10,0.5)". Firefox, Opera, Chrome.

.

+65
fill="#044B9466"

RGBA SVG, . , ...

2017 : RGBA Mozilla Firefox (54), Apple Safari (10.1) Mac OS X Finder " ". Google Chrome (60.0) ; .

+1

All Articles