Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Member KillaTeddyX's Avatar
    Join Date
    Dec 2006
    Posts
    81
    Member #
    14455
    Hi guys I am asking a really easy and probably silly question but lets see if you can help me. I am working on a personal site and I have decided that I want to put all my Javascipt and CSS files into a sub folder called scripts I usually don't do this but its my site and I want to try something different, what seems to be the issue is that I can't seem to get my background jpg to show when using this method below is the code lets see if its an error there.

    HTML Code:
    <html>
    <head>
    <title>My Page</title>
    <link rel="stylesheet" type="text/css" href="scipts/base.css" />
    </head>
    <body>
    </body>
    </html>
    Code:
    /* CSS DOCUMENT*/
    body {background: url(/images/blue.jpg) repeat-x}
    Please help this pobably really simple and really obvious that im gonna kick myself once I know.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    scipts
    Spelled wrong.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Member KillaTeddyX's Avatar
    Join Date
    Dec 2006
    Posts
    81
    Member #
    14455
    Filburt this is a typo I made here the names match.

  5. #4
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    For some reason I usually don't have an opening slash in the URL.

    So I go url(images/blue.jpg) instead of url(/images/blue.jpg). And in case this sort of thing happens again, to troubleshoot this kind of problem you first want to make sure each link in the chain is working - is the stylesheet properly linked to (try do something like background: #f00 first to see if the background becomes red), then test the image url, etc.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Keep in mind what that opening / means. A lack of it means that your URI is relative to where the actual web page is. Its presence means your URI is relative to your document root, so if the document is at [minicode]http://www.mycoolsite.com/place/superplace/test.html[/minicode], [minicode]/images/test.png[/minicode] would refer to [minicode]http://www.mycoolsite.com/images/test.png[/minicode] , and [minicode]images/test.png[/minicode] would refer to [minicode]http://www.mycoolsite.com/place/superplace/images/test.png[/minicode].

  7. #6
    Member KillaTeddyX's Avatar
    Join Date
    Dec 2006
    Posts
    81
    Member #
    14455
    Hehe I found the answer I was looking for I had to tell the css file to come up one directory using ".." thanks to all those that helped. <kicks himself for bieng silly>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:52 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com