#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    Canberra, Australia
    Posts
    348
    Rep Power
    13

    BG image relative to page or CSS


    Im just wondering defining a background image in css.

    I know I can use relative and absolute addresses, but

    Is the url background-image: url('img.gif'); relative to the CSS or to the page and is it different for each browser.
  2. #2
  3. Retired
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Finland
    Posts
    9,143
    Rep Power
    2493
    Relative to the CSS. You could either put the full URL in there, or put the link relative to your top level (root) directory. eg.

    top level:
    index.htm
    images directory
    stylesheets directory

    In your style sheet put: background-image: url('/images/img.gif');

    HTH

    Cheers,
    Jamie

    >_ skiFFie ? | Twitter

    __________________

    Let the might of your compassion arise to bring a quick end
    to the flowing stream of the blood and tears .....
    Please hear my anguished words of truth.

    __________________

IMN logo majestic logo threadwatch logo seochat tools logo