I'm having some problems filling an InlineSVG. I have a div
with the svg:
<div class="svg-div" [inlineSVG]="'../../../assets/images/add.svg'"></div>
Then in CSS:
.svg-div {
fill: blue;
}
but the icon remains grey.
I've also tried:
.svg-div ::ng-deep svg{
fill: blue;
}
in different combinations, but nothing worked.
Here is the link to my stackblitz . What's wrong?
It is not working because fill attribute is hardcoded in your svg file. Remove fill="#7A7A7A" from your svg file then you will be able to change color through css.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.