Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Sep 2006
    Location
    Colorado
    Posts
    132
    Thanks
    7
    Thanked 1 Time in 1 Post

    Page not loading style sheet

    So I've decided to re design my website. Cause its absolutely horrible. I got a CSS template which is found here:
    http://hugelaughs.com/newsite/test/
    Style Sheet:
    http://hugelaughs.com/newsite/style.css

    For whatever reason the stylesheet is not being loaded, I cant figure out why.

    I know this will be one of those stupid answers that I should be able to get by myself but for whatever reason I cant this morning lol.
    -bubbles

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,027
    Thanks
    2
    Thanked 315 Times in 307 Posts
    Your style sheet file is actually one folder below the current folder "test".

    Try changing ./style.css to ../style.css in the <link tag.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    Regular Coder
    Join Date
    Sep 2006
    Location
    Colorado
    Posts
    132
    Thanks
    7
    Thanked 1 Time in 1 Post
    Actually I have .htaccess set to read:

    http://hugelaughs.com/newsite/test/
    as
    http://hugelaughs.com/newsite/test.php

    Its in the same directory.
    -bubbles

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,027
    Thanks
    2
    Thanked 315 Times in 307 Posts
    The URL of the page in the browser is - http://hugelaughs.com/newsite/test/

    The browser then takes this along with the href="..." information to form the URL where it fetches the external css file from. If the href is relative, the browser just appends it to the end of the URL for the current page -
    ./style.css gives - http://hugelaughs.com/newsite/test/style.css
    ../style.css would give http://hugelaughs.com/newsite/style.css

    Edit: An alternative, if your files reference an external css from different url-paths, would be to use an absolute URL in the href="..."
    Last edited by CFMaBiSmAd; 01-03-2007 at 05:38 PM.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #5
    Regular Coder
    Join Date
    Sep 2006
    Location
    Colorado
    Posts
    132
    Thanks
    7
    Thanked 1 Time in 1 Post
    Ah okay, that makes sense. It worked. Thanks a lot.
    -bubbles


  •  

    Posting Permissions

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