css script need background image relative to document root

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miranda
    New Member
    • Apr 2008
    • 1

    #1

    css script need background image relative to document root

    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
  • harshmaul
    Recognized Expert Contributor
    • Jul 2007
    • 490

    #2
    Originally posted by miranda
    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....

    Code:
    .bgentrypagepic {
    
    background-image: url(images/entryimage.jpg);
    background-repeat: no-repeat;
    }
    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

    Comment

    Working...