Forum Moderators: not2easy
The problem is that at random, on slow connections, the CSS fails to load. The page ends up without a layout. Upon refresh the CSS loads.
I have seen this issue on Slashdot's website once.
What's the reason and what's the remedy? My CSS is not very heavy, on some pages it is 8k and on others it's 9k.
The problem has been noted on Webmasterworld before; see for example here [webmasterworld.com] and here [webmasterworld.com].
It sounds like an IE bug. If you wanted to stop it happening on, say, your home page, you could place the CSS for that page directly in the header. In fact, you may be able to strip out most of the CSS, as you'd need only what is relevant for that page. So the home page may even end up loading faster! The downside would be a delay of an additional page before the external CSS file is cached.
Another thing to watch for is that your server is set to serve CSS files as text/CSS and not anything else.
It's worth trying to design your site, so it works reasonably well without CSS (For US government sites this is a requirement), but you could consider including the most vital parts of the CSS within a <style> delaration in the page content (not too much though) and then having a later line which actually includes your stylesheet.
This means that if you update your styles in the future, the linked one will take precendence without you having to change the pages, but if it fails to load you'll still have a prettier site than with no CSS.
This is based on the Cascade part of the "Cascading Style Sheets".