Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder ghostz00's Avatar
    Join Date
    Aug 2006
    Posts
    128
    Thanks
    11
    Thanked 2 Times in 2 Posts

    Background image is in a directory behind the stylesheet

    This is probably a simple answer, but I can't seem to get it to work other than using:

    Code:
    background:url("http://myurl.com/images/background.gif");
    The Style sheet is located: myurl.com/css/style.css

    Is it ok to leave it in the url form? I would think it might add some extra loading time.

    thanks in advance,
    Greg

  • #2
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by ghostz00 View Post
    This is probably a simple answer, but I can't seem to get it to work other than using:

    Code:
    background:url("http://myurl.com/images/background.gif");
    The Style sheet is located: myurl.com/css/style.css
    In that case this should be working:
    Code:
    background:url("../images/background.gif");
    Quote Originally Posted by ghostz00 View Post
    Is it ok to leave it in the url form? I would think it might add some extra loading time.
    I should not make any difference. But using a relative path may be better if you one day choose to move the site to another domain. You wouldn't have to modify your style sheet.

  • #3
    Regular Coder ghostz00's Avatar
    Join Date
    Aug 2006
    Posts
    128
    Thanks
    11
    Thanked 2 Times in 2 Posts
    Thanks a lot. That worked, I didn't know that you could use that shorthand in the css.
    Greg


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •