Results 1 to 3 of 3

Thread: Dynamically link to css file

  1. #1
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default Dynamically link to css file

    This is what my websites directory looks like.

    fldrstudios/
    template.php

    Home/
    index.php

    Contact/
    index.php
    Process/
    index.php

    (process is a subdirectory of contact and contact and home are both subdirectorys of fldrstudios.)

    Now my problem is, when you move from one page to another, the content of the page is included into template.php so you don't have to rewrite out the layout of the website each page.

    The problem is if you are visiting a directory within a directory, because the css is included like this

    Code:
    <link rel="stylesheet" type="text/css" href="../Css/fldrstudios.css" />
    on template.php but for Process/index.php it should be like this

    Code:
    <link rel="stylesheet" type="text/css" href="../../Css/fldrstudios.css" />
    
    Is there a way to dynamically find the css file then link to it?
    Last edited by keyboard; 03-19-2012 at 08:18 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Use the absolute or the network path.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

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
  •