Results 1 to 5 of 5

Thread: Linking back to previous folders.

  1. #1
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)

    Linking back to previous folders.

    Ok let me explain.

    I have a folder which contains the following: My index page, a contents page for html tutorials page and a css stylesheet.

    From my index page i have a link to my HTML contents page. At the moment im currently in the process of makeing an introduction page for HTML. Now heres where my problem comes in. In that folder i wish to place a folder called "Tutorials" into which i will have a HTML folder, where i will store tutorial pages on html. My problem is, how would i link back to my style sheet in the base folder from "/tutorials/html/intro.html"? so that this intro page has access to my style sheet? Sorry if this is obvious, but my brain isnt working correctly right now.

    EDIT: 300th post!!! what a mile stone

  2. #2
    Senior Member Shad's Avatar
    Join Date
    Jul 2003
    Location
    In front
    Posts
    2,773
    Thanks
    22
    Thanked
    40 times in 24 posts
    Can't you make the link to your stylesheet something like "/bin/styles.css" for all of the pages?
    Simon


  3. #3
    Pixel Abuser Spunkey's Avatar
    Join Date
    Nov 2003
    Location
    Milton Keynes
    Posts
    1,523
    Thanks
    0
    Thanked
    0 times in 0 posts
    you can use the old DOS ../ to go back up a directory.
    So from /tutorials/html/intro.html the link to your CSS would be ../../myStyle.css. Problem being this will need amending for each new directory you put pages in.

    Shad's idea is the best way to go, put the CSS in its own dir, and then use a /folder/file.css link, as this will not need to be changed, regardless of what dir you're in

  4. #4
    Ex-MSFT Paul Adams's Avatar
    Join Date
    Jul 2003
    Location
    %systemroot%
    Posts
    1,926
    Thanks
    29
    Thanked
    77 times in 59 posts
    • Paul Adams's system
      • Motherboard:
      • Asus Maximus VIII
      • CPU:
      • Intel Core i7-6700K
      • Memory:
      • 16GB
      • Storage:
      • 2x250GB SSD / 500GB SSD / 2TB HDD
      • Graphics card(s):
      • nVidia GeForce GTX1080
      • Operating System:
      • Windows 10 x64 Pro
      • Monitor(s):
      • Philips 40" 4K
      • Internet:
      • 500Mbps fiber
    I would recommend against using relative paths, they become problematic if you move files around.

    I make every reference to my stylesheets explicit regardless of where they are linked from:

    e.g.
    <link rel="stylesheet" href="/mystylesheet.css">
    or
    <link rel="stylesheet" href="/stylesheets/mystylesheet1.css">

    If I have just 1 stylesheet for the whole site, I put it in the root, and if there area few I create a folder from the root called stylesheets and drop them in there.
    ~ I have CDO. It's like OCD except the letters are in alphabetical order, as they should be. ~
    PC: Win10 x64 | Asus Maximus VIII | Core i7-6700K | 16GB DDR3 | 2x250GB SSD | 500GB SSD | 2TB SATA-300 | GeForce GTX1080
    Camera: Canon 60D | Sigma 10-20/4.0-5.6 | Canon 100/2.8 | Tamron 18-270/3.5-6.3

  5. #5
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)
    Thanks for your help guys, i dont know if ive been doing it right but the only method that worked for me was the ../../ way. I had used this before but i didnt know i needed and extra ../ for each previous folder I seem to have it sorted now tho, thanks again

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Wanted - Custom PC back issues
    By sirelmo in forum Retail Therapy and Bargains
    Replies: 2
    Last Post: 28-07-2004, 08:30 PM
  2. yeeah im back but it not good at all thx to scan
    By bigjonnyauk in forum PC Hardware and Components
    Replies: 5
    Last Post: 22-05-2004, 01:59 AM
  3. Has the WaveMaster a changeable back panel?
    By The Hand in forum Chassis and Mods
    Replies: 6
    Last Post: 26-03-2004, 10:02 PM
  4. system folders on second hdd
    By Gubs in forum Software
    Replies: 1
    Last Post: 14-08-2003, 02:59 PM

Posting Permissions

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