img src SVG changing the styles with CSS

后端 未结 22 2319
予麋鹿
予麋鹿 2020-11-22 01:16

html

\"Logo\"

css

.logo-img path {
           


        
22条回答
  •  日久生厌
    2020-11-22 02:08

    2018: If you want a dynamic color, do not want to use javascript and do not want an inline SVG, use a CSS variable. Works in Chrome, Firefox and Safari. edit: and Edge

    
        
    
    

    In your SVG, replace any instances of style="fill: #000" with style="fill: var(--color_fill)".

提交回复
热议问题