Design comparison
SolutionDesign
Solution retrospective
Does anyone know to change the color of SVG elements??
Community feedback
- @IkuewumiPosted 9 months ago
Hi @IAMVICTHECG. Changing the color of an SVG can only be done if the vector is inline in the html, and doesn't work with an SVG linked in a
<img>
tag.If the SVG is in your markup, you can target it with a CSS selector and change its color with the
fill
css property:For example
HTML
<svg></svg>
CSS
svg { fill: blue; }
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord