I am trying to fill a svg image with css.
<object type="image/svg+xml" data="img/test.svg" style="fill: #FF0;">Your browser does not support SVG</object>
Somehow it doesn't work. Any Ideas? Thanks!
I am trying to fill a svg image with css.
<object type="image/svg+xml" data="img/test.svg" style="fill: #FF0;">Your browser does not support SVG</object>
Somehow it doesn't work. Any Ideas? Thanks!
CSS styles don't apply across document boundaries. The SVG is a separate document from the HTML.
However there are other ways to achieve the effect you want. For instance, you could use jQuery to alter the SVG on hover events. Or you could insert the correct CSS rules into the SVG at load time as per this trick from Eric: