SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    directory structure trouble and css

    having trouble with css. For some reason when I link to a .css file from my index page the structure will be.

    rootdir > index.shtml > css >index.css

    it does not work, however, if I put the css folder into another folder eg.

    rootdir > index.shtml > style > css > index.css

    it works. You would not believe how much time I waisted trying to get my stylesheet to work.

    Does anyone have any sort of explaination or has any one else encountered this?
    Last edited by crankin; Apr 30, 2002 at 17:30.

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you explain the problem a bit more indepth? I would love to help you out, but all I can do right know is show my sympathy for your problems .

  3. #3
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <link rel = "stylesheet" type = "text/css" href = "style/css/index.css ">

    what directory do you have in the link for your css?

  4. #4
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't quite understand the question, but a very useful general tip for paths in HTML (which would include paths to your CSS) is this: If a path STARTS with a / it will be considered as starting at the root of your site.

    Example: I used to have a site with content in quite deep subdirectories. As a result I had a lot of image links that looked like this:

    <img src="../../../images/logo.gif">

    It turned out that this was completely un-necessary. If the image directory is here:

    www.example.com/images/

    The image HTMl can look like this:

    <img src="/images/logo.gif">

    That link will work anywhere on the site, no matter how many nested subdirectories you have. Because the path starts with a slash the browser treats it as starting at the base of the server.

    That's probably not what you wanted to know at all but I hope it helps anyway

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cheers never knew that with the slash

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re

    cheers for quick replies guys,

    though I know about the slash, the problem seems to be with the server handling of css.

    for some reason my page wont recognise a .css file which is in a folder directly off the root. But if I put that css folder into another folder and link to it...it magically works.

    its crazy.


Bookmarks

Posting Permissions

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