SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Uh oh, style sheet isn't loading

    When I go to www.btkdesigns.com on my machine, the site doesn't come up, but acts like there is no style sheet. Could someone help me out please?

    Thanks
    Bryan

  2. #2
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works fine for me in Firebird 0.7. Have you cleared your cache?
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  3. #3
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Of course not John, and that is why I am a moron

    Thanks for the tips, works all good now.

  4. #4
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many people are complaining they can't see my site because my stylesheets aren't loading. Is there any way I can force the new style sheets to load for those people who haven't cleared their cache. To be honest, I don't even know if these people have ever visited my site before.

    Thanks
    Bryan

  5. #5
    SitePoint Zealot Arkkimaagi's Avatar
    Join Date
    Mar 2002
    Location
    Lappeenranta, Finland
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried changing the stylesheet name?

  6. #6
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, here is what I have done.

    I have made two folders, one called styles and the other called scripts.

    I have downloaded all my .htm files and made the necessary changes, then I re-downloaded the styleswitcher.js file. I have uploaded the appropriate styles and styleswitcher.js to their appropriate folders. Then I reuploaded all the .htm files. Oh I also moved the styleswitcher up above the <link> in my <head>

    Let me know if you are still getting the bad front page.
    http://www.btkdesigns.com

    Thanks alot
    Bryan

  7. #7
    SitePoint Wizard Keriam's Avatar
    Join Date
    Jun 2003
    Location
    Colorado, USA
    Posts
    1,178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uh oh, I think you have some other major issues. When I go to the site I am getting a funky looking page that tells me I am using an older browser. Pardon me? WinXP Pro IE6. Something is wrong, fer sure! By the way, the "good" page blinks in briefly before getting the funky page.

  8. #8
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,798
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Hi,

    No stylesheet is loading because you haven't set the default stylesheet.

    You need this as well:
    Code:
    <link rel="stylesheet" type="text/css" href="http://www.btkdesigns.com/styles/medium.css" media="screen"  />
    (i.e. without the title="medium")

    Now the default stylesheet will load.

    Also I think the javascript styleswitcher should come after the link statements otherwise the switcher will load the style from the cookie and then be overwritten by the default stylesheet. Well that's where I place it in my pages and it works perfectly.

    Paul

  9. #9
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul, I will give it a shot.

    Since the first <link> will not use a title, I should then have another one that does, so the full thing will look like this.

    Code:
    <link rel="stylesheet" type="text/css" href="http://www.btkdesigns.com/styles/medium.css" media="screen" />
    <link rel="alternate stylesheet" type="text/css" href="/styles/small.css" media="screen" title="small" />
    <link rel="alternate stylesheet" type="text/css" href="/styles/medium.css" media="screen" title="medium" />
    <link rel="alternate stylesheet" type="text/css" href="/styles/large.css" media="screen" title="large" />
    <link rel="stylesheet" media="print" type="text/css" href="/styles/print.css" />
    <script type="text/javascript" src="/scripts/styleswitcher.js"></script>

  10. #10
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,798
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Yes, that's the way I do it and it seems to work ok.

    Paul

  11. #11
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but I see sites all the time not use that method, but the relative path, or absolute, can't remember. Vinniegarcia doesn't do it that way.

  12. #12
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh, and do I want that only on the first page? Because I was thinking if I put it on my other pages, and the person happens to change to either small or large, then they change pages, won't the medium automatically kick in?

  13. #13
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,798
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Hi,

    Sorry I confused you

    Use the relative path - I just used the absolute path so that i could link to your stylesheet for testing. (Sorry - my fault).

    The whole block including the styleswitcher needs to be on all pages.

    When a page loads the default sylesheet is loaded. If the user has never visited or has javascript turned off then they need the default style.

    When the page loads the javascript is run and the cookie is checked and if it has been set then the active style sheet is implemented if not they get the default.

    Paul

  14. #14
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    got ya, time to FIND AND REPLACE

  15. #15
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,798
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    You might find this of some use.

    Because 10% of users have javascript turned off the stylechanger is of course no use to them. So rather than annoying them with some function that doesn't work I use this simple technique.

    Code:
    <style type="text/css">
    .vanish {
    display:none;
    } 
    </style>
    <script type="text/javascript">
    <!--
    document.write("<style type='text/css'>.vanish{display:block}</style>");
    if ((navigator.appName == "Opera") && (parseInt(navigator.appVersion)<7)) {
    document.write("<style type='text/css'>.vanish{display:none}</style>")
    }
    //-->
    </script>
    html:
    Code:
    <div class="vanish">
    stylechanger stuff etc.....
    </div>
    Basically you set the div that the stylechanger html is contained in to display:none so that it doesn't show by default. Remembering that the stylechanger only works if javascript is enabled you can then write some javascript that sets the display to block.

    This means that only those with javascript enabled get the stylechanger and the others won't be bothered with it.

    You could also include the browsers that the javascript doesn't work on if you wanted. I have included Opera 6 and under as it only seems to work on Opera 7.

    Just thought it may be of some use (I installed one on this site for a friend if you want to see it working: http://www.tunna-resources.co.uk/ ).

    Paul

  16. #16
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul, I appreciate the help.

    I have uploaded the new files, so hopefully its 100% now.

  17. #17
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,798
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Just tested in IE6 and Mozilla1.2 and it's working fine now

  18. #18
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool. Gracias


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
  •