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.

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.

commented: like to see people explain +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.