CSS Loading

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
sirstrumalot
Forum Commoner
Posts: 27
Joined: Mon May 18, 2009 10:26 pm

CSS Loading

Post by sirstrumalot »

Okay, simple question:
Why is is that when I access my webpage from any particular place, the page will load without the CSS styles for just a split second and then it looks normal? How do you get around this so that the page always loads correctly from the visible beginning?
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: CSS Loading

Post by mikemike »

It's just how the browser loads elements, ytou can't change it really.

The same thing happens to me on my slow connection when i visit websites sometimes, and it's not small time sites either, things like Facebook, MSN, etc.

You could always style everything inline, but I'd recommend against that.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: CSS Loading

Post by omniuni »

Oddly enough, sirstrumalot, not only do most browsers parse the CSS after the HTML, but some websites actually encourage this by putting the link to the CSS towards the end of the file. It actually speeds up page display. That said, to keep things as smooth as possible for display, make your HTML and CSS as efficient as possible, and if you use images for backgrounds, approximate it first with a color.
Post Reply