0

I am using a SVG image as background like this:

background:url("images/button2.svg") no-repeat 0 0 / 100% 100%;

I wonder if I can change the color of the fill and stroke with CSS only so I can have the same image on different places and a different style every time.

Thank you.

Johannes
  • 59,058
  • 16
  • 59
  • 114
Cain Nuke
  • 2,515
  • 4
  • 35
  • 55

1 Answers1

0

You can't do it when it is in the background. You'd better use it in an <img> tag and then embed it. There are already some scripts for that. I created my own recently: https://github.com/IskrenStanislavov/svg-embed