Answer the question
In order to leave comments, you need to log in
How to correctly specify a link to an svg sprite through the img tag or through the css background/background-image property?
Made sprite automation using gulp-svg-sprite.
Everything works fine if you use this method:
<svg class="icon-name">
<use xlink:href="./img/sprite-icons.svg#name" />
</svg>
<img src="./img/sprite-icons.svg#name" alt="" />
.icon {
background-image: url('./img/sprite-icons.svg#name')
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question