1

I used src in my code and when i want to be active , i want to change the color of the svg that i used . HTML:

<img src="../icons/Burgers.svg" class="icon" />

so i used in icon-menu-bar css :

.icon{
fill:red;
}

but the SVG doesn't changed . SO the main problem is change svg color in my html , and the SVG is on different file .

bryanghsb
  • 69
  • 2
  • 9
  • 1
    Possible duplicate of [Change svg color](https://stackoverflow.com/questions/22252472/change-svg-color) – Michael Nov 21 '18 at 09:04

2 Answers2

0

If you want to change the color of the icon SVG, you should convert SVG images to a font (https://icomoon.io/app/#/select), and after that include it to own project and change color.

P.S: A lot off UI libraries have own set of icons, for example:

0

you can use ng-include to import svg elements to code, then select your specific element from imported svg and change css . for example :

<div class="icon svg" ng-include=" '/assets/img/icon.svg' " > </div>

.icon.svg svg {
  fill:red;
}

hope this help your time.