#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    304
    Rep Power
    11

    Link to .CSS via full url path???


    I am building a template page, this has the header only stored in the page, then a php page is loaded from a different file as the body of the page,

    how do i set a full path to my css style sheet via the template page:

    i.e. http://mysite.com/styles/mycss.css

    for some reason this doesn't work! I can't set the path using '../../styles/mycss.css' because the template file will be stored in many different depths of my site,

    SO: How can i set some sort of path to the css file?

    any help will be appreciated!

    Cheers, Alex.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2003
    Posts
    1,014
    Rep Power
    15
    How about:
    Code:
    <link rel="stylesheet" type="text/css" href="http://mysite.com/styles/mycss.css" />
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    304
    Rep Power
    11
    cheers! thats really wierd I tried to swap http full url for the ../ stuff before and it just messed up and other people have said they couldn't link to css by the full http link but it works now?

    why is that, do you know?

    cheers again, Alex.
  6. #4
  7. Resident DJ
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    283
    Rep Power
    14
    you can also do a root link:

    <link rel="stylesheet" href="/styles/style.css" type="text/css"/>
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    304
    Rep Power
    11
    Ok Mate Cheers For That!

    Respect!

IMN logo majestic logo threadwatch logo seochat tools logo