CSS pointing to images directory?

Soldato
Joined
28 Sep 2008
Posts
14,218
Location
Britain
Hi guys,

Just trying to slipstream my website files and folders.

I have the following structure

includes folder which has:

includes/images
includes/css
includes/scripts

in my screen.css file, I have a format background which points to an image in the images folder.

In the CSS file, I have tried:
Code:
background: #ccc url(../images/navseperate.gif) no-repeat top right;
background: #ccc url(includes/images/navseperate.gif) no-repeat top right;

but neither of those work. It works if I move the images folder to within the CSS folder (i.e. includes/css/images)

How do I resolve this?

Thanks
 
The first one should work perfectly fine as it's relative to the location of your CSS file.

I use the same structure for all my sites, except I use 'media' instead of 'includes'.
 
Code:
background: #ccc url(/includes/images/navseperate.gif) no-repeat top right;
:)

The one you have in your post translates as "from the current folder/url, in the includes folder, in the images folder, file named" where as when adding the preceding slash it translates to "from the root folder, in the includes sub folder, in the images subfolder, file named"
 
Code:
background: #ccc url(/includes/images/navseperate.gif) no-repeat top right;
:)

The one you have in your post translates as "from the current folder/url, in the includes folder, in the images folder, file named" where as when adding the preceding slash it translates to "from the root folder, in the includes sub folder, in the images subfolder, file named"

Ok, tried that, still nada.

If my CSS file is in the root with the webpages and I have an images folder, all works rosey, but I don't want that really :(
 
Opps, my bad. Working now, I had this in my HTML /\screen.css

And as an FYI, this works:

../images/navseperate.gif

This doesn't (for some odd reason)

/includes/images/navseperate.gif
 
Back
Top Bottom