0

I'm trying to recolor a simple SVG image with CSS (as I saw here http://codepen.io/chriscoyier/pen/evcBu ):

My HTML: <img src="http://dl.dropbox.com/u/12091580/rwdicon/icon-menu.svg" class="myMenu" alt="menu">

My CSS: .myMenu { fill: red; }

It's not working (see http://jsfiddle.net/sexyzane/1hojaccb/ )!

What am I doing wrong?

  • This will help you. http://stackoverflow.com/questions/11978995/how-to-change-color-of-svg-image-using-css-jquery-svg-image-replacement – Kheema Pandey Aug 08 '14 at 12:23

1 Answers1

3

fill is used for svg element markup, you have an img element with an svg source, as such you cannot use fill to change the image color.

Instead, if you want to colorize the image, you may want to look into applying a CSS filter effect to the img tag, although this may not be able to achieve the exact result you're after.

Demo Fiddle

SW4
  • 69,876
  • 20
  • 132
  • 137