Skip to content Skip to sidebar Skip to footer

Changing The Color Of An Svg Image Using Css

I have the following svg image in my html file: Now, I am trying to change the color using this css code: .svg path { fill: bla

Solution 1:

You have to use an inline SVG, where the path element is inside the HTML, as opposed to linking to an external SVG.

Example: https://jsfiddle.net/fznuckb0/1/

.path-name {
    fill: tomato;
    fill-rule: evenodd;
}

Solution 2:

if you are using the svg in a image tag, it is not possible to change anything within the SVG...

to do that, you have to include the whole SVG inline... look for example here: link

Post a Comment for "Changing The Color Of An Svg Image Using Css"