SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Feb 2001
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Do style sheets sometimes fail to load?

    I have noticed that very occasionally on sites that use external style sheets to control fonts etc that they fail to work (i.e all the text appears as the browser default rather than what is defined in the sheet). Does anyone know if this is the external sheet simply failing to load or if the browser just occasionally fails to implement it?

    If it is a failure to load is there any method of checking if a style sheet has loaded?

    thanks for any help

  2. #2
    SitePoint Zealot Drew630's Avatar
    Join Date
    Nov 2001
    Location
    Maryland
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a specific problem that you are having with this? Also, does it only happen with certain pages?

    If the problem is just fonts, you may be using fonts that are incompatible with a user. For the font to work in the browser, the user has to have the font on his machine. So if you use a new, awesome looking font and then try to access the page on another machine, you may just see the standard font, simply for this reason. If you are missing other CSS components, then check to see how you are refernecing the CSS in the page that "Fails to load it". I don't know of any other way yo tcheck to see if it loads unless you put a widly obvious change in the Style sheet and see if that appears in the web page.

    If this doesn't help, post some code with specifics and I'll se what I can do.

    Drew
    ~Drew

    There Is No Greater Joy Than Soaring High On The Wings Of Your Dreams, Except Maybe The Joy Of Watching A Dreamer Who Has Nowhere To Land But In The Ocean Of Reality.

  3. #3
    SitePoint Addict
    Join Date
    Feb 2001
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think I've put the question very clearly so I'll try again, sorry!

    Say I visit http://www.linkdup.com for example, most times it appears exactly how it should however, very occasionally it will load up incorrectly, the text will appear in times new roman and at a larger than normal font size, so it seems to me that the style sheet failed to load and thus the text just appears in the default font and size of my browser. I am using AOL 6.0, so I don't know if this just happens on AOL browsers or effects evryone.

    The reason I want to know if there is a way to detect if a stylesheet has loaded is that I often put positioning information in them, therefore if that failed to load it would be a real problem, not just a case of the font being effected.

  4. #4
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I know that this problem has been mentioned about SP itself, and well its just one of those things with the browser doing so much the stylesheet gets left out I have noticed it twice on SP in well 7 months, I don't know whether you can test for it other than to refresh the page as that is all you need to do to fix it.

    If you are getting it more frequent that that then its certainly a bug or some sort

    hmm not much help there am I?

    Sarah
    Regular user

  5. #5
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    When the browser is loading a page it initiates a new request for all external files and images. Depending on your network connection at the time, some of these requests can fail since there is a hardcoded amount of time allotted for the response from the server. If the server is overworked and busy, the chances of these requests failing is increased.

    Since the most browsers are designed to carry on if it can't find a file it will render the page as best it can without the missing files. If the files, are crucial, you can always refresh and new requests for the missing files only will be generated.

    The only browser that doesn't render with missing documents is Netscape 4.XX. Instead it gives you a 404 error display and doesn't render anything.
    Wayne Luke
    ------------



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
  •