0

I have a svg file where I want to change the fill color using css. I tried using path but that didn't seem to work either.

html

<img src="assets/img/star.svg" class="sidefigure">

css (sass)

.sidefigure{
    svg{
        polygon{
            fill: red;
        }
    }
}

star.svg file

<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     width="500px" height="500px" viewBox="0 0 500 500" enable-background="new 0 0 500 500" xml:space="preserve">
<polygon points="250,14.455 326.535,169.526 497.667,194.394 373.833,315.104 403.069,485.545 250,405.075 96.933,485.545 
    126.167,315.104 2.333,194.394 173.467,169.526 "/>
</svg>
Raymond the Developer
  • 1,576
  • 5
  • 26
  • 57

0 Answers0