Ask coding questions

← Back to all posts
Embedded CSS in svg doesn't work as expected
EmilySeville7cfg

Hello! I have the following .html page:

I want both circles to change colors when cursor hovering. But now only second works properly.

Please consider this REPL.

Voters
EmilySeville7cfg
Comments
hotnewtop
Coder100

Hi, the reason the second one doesn't change because it is in an image tag, so that means the image will stay like that.

Edit: as op suggested <object data="image.svg"></object>

EmilySeville7cfg

@Coder100, solution is found: <object data="image.svg"></object>. :)

Coder100
Coder100

mark as correct answer? @EmilySeville7cfg

EmilySeville7cfg

Yes :) I've up voted your first comment

Coder100

click the check mark @EmilySeville7cfg