../

Discussion in 'HTML & Website Design' started by oo7ml, Sep 12, 2007.

  1. #1
    I have a page that needs to be in a new folder within the current sites directory. At first none of the links or images would show up until i put ../ infront of them all.

    Can someone explain to me how the ../ works and does the number of .. mean anything, thanks
     
    oo7ml, Sep 12, 2007 IP
  2. okgaz

    okgaz Well-Known Member

    Messages:
    450
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    128
    #2
    ../ moves up a directory.
     
    okgaz, Sep 12, 2007 IP
  3. mv808

    mv808 Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you really need those dots? I don't even use them on my site, and my images appear ok with only the "/".
     
    mv808, Sep 12, 2007 IP
  4. Indian_Webmaster

    Indian_Webmaster Banned

    Messages:
    1,289
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes ../ is needed...
     
    Indian_Webmaster, Sep 12, 2007 IP
  5. Boulder

    Boulder Well-Known Member

    Messages:
    806
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    118
    #5
    Yes as Indian_Webmaster has said, the double dots "../" are needed to move up one directory. Just a slash "/" would mean to look for a child directory inside the current one..

    To move up two directories would be like ../../directory

    Boulder

    :cool:
     
    Boulder, Sep 12, 2007 IP
  6. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If your images show up fine without the dots, then don't use them. The dots stand for current directory (or one below/further if you use ../../image.gif). If you only use / then that means your images are exactly the same folder/directory as your html and css.

    If my site, www.foo.com is directly on my server (/website/foo.html) and the images for the foo site are direct (/image.gif, /freebeer.jpg) then only slashes are needed. But let's say foo is at /website/foo.html and the images are in the main folder/dircetory. Then the dots come in.

    directory:
    / (r00t)
    /website/foo.html
    /freebeer.jpg
    /freespeech.jpg

    Now, you need the whole path. You can either use "http://www.foo.com/freebeer.jpg" OR you can replace the main foo folder with "../freebeer.jpg" the dots meaning in this case "don't stay in /website where foo is, but go back to the main part."
     
    Stomme poes, Sep 12, 2007 IP