0

I'm trying to get a specific part of an svg image (created in inkscape if it matters) to change colour on some event. I'm pretty sure that I can use css to do this, but I cannot figure out how to select the id from the specific svg file. If the object in the svg has id='ToChange' and the html tag has id='svgToChange', I'd think the css would be

#svgToChange #ToChange :hover {...}

but this doesn't seem to work. Any ideas? Would javascript be better for this?

1 Answers1

1
#svgToChange:Hover #ToChange{fill: #whatever}

Edit from question asker:

I figured out how to do it, the problem was because I had the svg in an img tag instead of an object tag.

Sharper
  • 327
  • 3
  • 17