Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change color of SVG sprite

Tags:

html

css

svg

I am using SVG sprite as my background image:

.naar-logo {
    background: url(images/salt_sprite.svg) no-repeat -8px -78px;
    width: 36px;
    height: 49px;
    position: relative;
    top: 38px;
}
<div class="naar-logo"></div>

Color of sprite images is black, but I want it to be white. I tried with:

background: url(images/salt_sprite.svg) no-repeat white -8px -78px;

and color: white; on .naar-logo clas, but it not work. How can I change color of svg sprite to be white?

like image 419
Nemus Avatar asked Oct 18 '25 15:10

Nemus


1 Answers

You cannot change the color with an external css. You need to inline the SVG in order to to that. Please read Using SVG for details.

like image 200
itacode Avatar answered Oct 21 '25 06:10

itacode