Mateusz Gebroski
Mateusz Gebroski

Reputation: 1334

background image does not work on github pages

Strange issue, everything is fine when testing locally, but not on github pages.

image is located under /img where sccs which points to this image is located under /scss/pages/ So in this case I need to go back two directories. It looks like this:

  background-image: url('../../img/blob-shape.svg');

As I said locally it is fine, but not github pages. Why?

You can check project structure here: https://github.com/geborskimateusz/my-resume

and github pages (this svg is placed in section of latest work): https://geborskimateusz.github.io/my-resume/

Upvotes: 0

Views: 171

Answers (1)

user9408899
user9408899

Reputation: 4540

Don't use relative location in production.

Try this:

background-image: url('/img/blob-shape.svg');

Upvotes: 2

Related Questions