Design comparison
Solution retrospective
Does anyone know how to make the .svg backgrounds work on github pages?
Community feedback
- @macdeeshPosted over 2 years ago
Hello lilKriT, Just to answer to your question, maybe you can add ".." before the URL of the background image :
background-image: url("../img/icon-supervisor.svg");
Instead ofbackground-image: url("/img/icon-supervisor.svg");
In your place, I will also use the pseudo-element ::after with the specific class and add :
content: url("../img/icon-supervisor.svg");
Marked as helpful0@lilKriTPosted over 2 years ago@macdeesh I'm not sure that the ../ will help. My code works fine on live server, just not on github :( But I will try it.
How would ::after help? I already insert icons as a background element, to avoid issues with screen readers.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord