I'm developing a online registration system. I have my CSS files loaded in javascript file using "skel.init". When loading other pages or refreshing the website. It loads CSS pretty slow that my website will appear with no css for almost 1 sec while loading. Are there any solutions that can fix this? (P.S. It's not my network's problem. I had my network tested)
2 Answers
If you load your CSS via a <link> in the <head> of your page, the browser will load the CSS before the HTML content of the page and you will not see the site without the proper CSS applied.
2 Comments
Eric Turner
Thanks a lot, but is there any other solutions? Cuz my stylesheets are control by my javascript. So if I load my CSS via <link>, some of the style will fail.
deadwards
Out of interest, why are your stylesheets "controlled" by your Javascript?
I know the problem... This is called the Flash of Unstyled Content. I solve this on Eliminate flash of unstyled content
<link>the css in the head normally so it can be optimized by the browser...