Answer the question
In order to leave comments, you need to log in
Why are svg icons not showing through css?
Hello.
Why are svg icons not showing through css?
If you open the icon simply in the browser, then it is displayed, if you put it through the styles, then for some reason it is not displayed, it is also not displayed in the developer tools, but if you open it in a new tab, then it is.
There is an example .
In this example, there are two svg files, one is displayed correctly, the second is not, what is the reason?
Answer the question
In order to leave comments, you need to log in
in css, the url() function specifies either an absolute path to the file, or a relative one, moreover, it is relative to the css file. For example, if the structure is:
css/style.css
img/icon.svg
then in css it will be
url('../img/icon.svg')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question