Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Changing the color of a SVG image - Kevin Powell - Community
KP-C
Kevin Powell - Community
•
2y ago
•
37 replies
rayannn
Changing the color of a SVG image
My code is as follows
:
<div>`
`<button class="modal-close"><img src="svg"></button>`
<div>`
`<button class="modal-close"><img src="svg"></button>`
<
/div
`
I cant change the color of the svg with fill
, color or applying fill in the svg file itself
. I
've also tried
!important but neither worked
. i
've tried the options below and none applied the color
.
.modal
-close
{
color
: white
;
}
.modal
-close img
{
color
: white
;
}
<svg fill
=
"white
"
>
Kevin Powell - Community
Join
A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.
36,263
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
SVG Component color not changing on hover
KP-C
Kevin Powell - Community / front-end
4y ago
CHANGE COLOR SVG
KP-C
Kevin Powell - Community / front-end
4y ago
How to change the color of an <svg> image when I hover the mouse
KP-C
Kevin Powell - Community / front-end
3y ago