By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,044 Members | 1,377 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,044 IT Pros & Developers. It's quick & easy.

css script need background image relative to document root

P: 1
I have a different table background image to be displayed for pages residing under different directories. I want the css script to indicate the table background image relative to each page. Each directory contains a subdirectory "/images" each of which contains a different image with the same filename "entryimage.jpg"

Here's the css class I've got that is not relative:
******************
.bgentrypagepic {

background-image: url(/images/entryimage.jpg);
background-repeat: no-repeat;
}
******************
Will greatly appreciate a solution.
Sharon
Apr 3 '08 #1
Share this Question
Share on Google+
1 Reply


harshmaul
Expert 100+
P: 490
I have a different table background image to be displayed for pages residing under different directories. I want the css script to indicate the table background image relative to each page. Each directory contains a subdirectory "/images" each of which contains a different image with the same filename "entryimage.jpg"

Here's the css class I've got that is not relative:
******************
.bgentrypagepic {

background-image: url(/images/entryimage.jpg);
background-repeat: no-repeat;
}
******************
Will greatly appreciate a solution.
Sharon
Hi,
Firstly use code tags, its easier to read secondly you are using an absolute root. try this code....

Expand|Select|Wrap|Line Numbers
  1. .bgentrypagepic {
  2.  
  3. background-image: url(images/entryimage.jpg);
  4. background-repeat: no-repeat;
  5. }
NOTE i removed the / from before the /images.

i think that will work better as CSS put in between the head tags of the document
Apr 7 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.