How do I change the color of an SVG in HTML?

How do I change the color of an SVG in HTML?
Answer
Edit your SVG file, add fill=”currentColor” to svg tag and make sure to remove any other fill property from the file. Note that currentColor is a keyword (not a fixed color in use). After that, you can change the color using CSS, by setting the color property of the element or from it’s parent.
 

Tìm kiếm

Back
Top