opacity vs fill-opacity in svg

后端 未结 4 958
旧巷少年郎
旧巷少年郎 2021-02-20 00:51

What is the difference in opacity vs fill-opacity in SVG?

I referred the docs for fill-opacity and opacity but I am confused what is meant by

4条回答
  •  隐瞒了意图╮
    2021-02-20 01:12

    I found this table helpful when considering which flavor of opacity to use with SVG. Let's not forget about stroke-opacity and stop-opacity.

    |    Attribute   |             Explanation            |              Applies to:             | 
    |:--------------:|:----------------------------------:|:------------------------------------:|
    | opacity        | The overall opacity of the element.| Everything but gradient stops        |   
    | fill-opacity   | The opacity of the fill paint.     | Elements with the attribute 'fill'   | 
    | stroke-opacity | The opacity of the stroke paint.   | Elements with the attribute 'stroke' |
    | stop-opacity   | The opacity of the gradient stop.  | Gradient stops                       |
    

提交回复
热议问题