5

I have an svg image on my page which I am including like this:

<img src="image.svg" class="arrow"/>
  • I want to change its color with css. Is this possible?
mheavers
  • 29,530
  • 58
  • 194
  • 315
  • I think you need to edit the image with a text editor and copy that in the html to do that. otherwise you can also use the very none-supported css property `-webkit-filter` – noob Jul 27 '12 at 22:15
  • I figured out a nice way to do this, I think it's by far the best way out there: http://stackoverflow.com/questions/11978995/how-to-change-color-of-svg-image-using-css-jquery-svg-image-replacement/11978996 – Drew Baker Aug 16 '12 at 01:08

2 Answers2

2

There's hue-rotate, but it's not really supported yet.

freejosh
  • 11,263
  • 4
  • 33
  • 47
  • 1
    thanks - this was really useful actually. Found a nice jsfiddle with a few properties that might work for me - http://jsfiddle.net/w3cplus/wThjx/ – mheavers Jul 28 '12 at 15:35
0

You can't. If you're trying to make it a rollover image, create a new SVG image with the changed colour, then look at this code to use JavaScript to make it a rollover image.

If you're not using it as a rollover, then I can't do any more.

Adam
  • 115
  • 1
  • 10