0

Hi All,

Well this is a simple problem, I'm developing websites for a client and I send them the html/css files with the regular url's in css like this -
#body {background-image: url(Images/bg.jpg);}

but they send me back the css file which has a Forward Slash '/' in the beginning of every url like this - #body {background-image: url(/Images/bg.jpg); }. This results in the images not appearing in my browser, I don't want to remove the forward slash from the entire css code because I've to send this css file back to the clients, so I'm trying to find a solution where such files will appear properly even while viewing locally.

Thanks Guys.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Kraai
2

The solution is easy, but let me explain something first:

the url path is where the actual image lies, on your machine, or on their machine, or on the remote server. If you have a folder on your machine with the css and all files related to the website inside that folder, and you can see the images with: url(Images/bg.jpg);} it means that inside your folder, you have another folder called "Images" where the bg.jpg is situated, and this tells your browser where to go and look for it.

Now, when you get the files back, they changed your url to where they have the images stored on their machine or server, so they can see the images as well. the forward slash in the beginning of the path means there is another directory before the directory that they use to store the script in.

To resolve, create another folder, and put everything as is inside that folder, and see if this solved your problem.

Votes + Comments
like to see people explain
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.