Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
mikescs
5,018 PointsWorking with SVG images
Hello treehousers,
I would like to ask how do i change a color of a svg image in CSS ?
I have a CSS element id #icon-box-1 and i am loading the svg file like this :
icon-box-1 {
background: url('icon.svg') center no-repeat; backgroun-size: 40px; background-color: #blue; margin-top: 220px }
But i could not figure out how do fill the color for the svg image. Also what i want is to change that color when you hover on that element.
1 Answer
Dustin Matlock
33,856 PointsPerhaps this is what you're looking for.
svg:hover #icon-box-1 { fill: fuchsia; }