I have a strange problem with paths, this one works (on Windows):
<div style="background:url('folder1/image.gif')...
But this one won’t work (no image shows up):
<div style="background:url('/folder1/image.gif')...
Still this page says exactly the opposite (not the first but the second version should work): Background not working for a div
Anybody knowing what the reason might be?
The first url is relative to the folder in server what your HTML is used to render the page.
Example, if you get:
it will look into: (example 2)
but if you are in another folder like:
It will look in:
If you use a ‘/’ in the beggin, the path isn’t more relative, it always look in the root website, like exemple 2 no matter where your html is located.