I cannot create relative path links

@asurasnyx,

It looks like the problem is that you are using the backslash (\) in your path. In many languages (including CSS, I believe) this character is what is known as an escape character. You can tell by the way it is a different color in VS Code in your screenshot.

To make that path work, there are a few things you can do:

  1. You can replace your backslashes with forward slashes (/). Notice that in @sonnynomnom’s reply, he recommended ./ and not .\.
  2. Alternatively, if you really love the Windows-style backslash, you can put two of them instead of one and the path should work as intended. For example, your path would be url("your\\path\\here\\Resources\\images\\background.jpeg")
  3. Finally, you can use the shortcut ../ to reference a file in the parent folder. In your case, you would type url("../images/background.jpeg")

Hope this explanation helps. Happy coding!

4 Likes