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
  • 64,305
  • 18
  • 73
  • 130
Cain Nuke
  • 2,843
  • 5
  • 42
  • 65

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