Answer the question
In order to leave comments, you need to log in
How to do fallback for svg in css styles?
Good morning friends. I have a problem, I don’t know how to properly make a fallback for svg using png, namely, I want to do it in the ::before pseudo-element, background doesn’t work there where you can list icons separated by commas. The result should be something like this:
Maybe there are some other ways to solve this problem?
Answer the question
In order to leave comments, you need to log in
You can write like this:
.selector::before {
content: "";
background: url(fallback.png);
background: url(background.svg);
}
.selector::before {
content: "";
background: url("background.svg");
}
.no-svg .selector::before {
content: "";
background: url("background.png");
}
I don’t know what fullback is, but what you want is done through use
and then you can style it in css, but svg doesn’t know background because there is fill
information on fill
information on use
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question