| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Free Ring Ding™
Join Date: Feb 2003
Location: Manchester
Posts: 9,502
|
css question
On some pure css sites that I visit, the page appears without any formatting or anything as if the style sheet was missing for a couple of seconds and then loads. Anyone know what causes this ? ..................
|
|
|
|
|
|
#2 (permalink) |
|
Dr. Lucien Sanchez
Join Date: Mar 2003
Location: UK
Posts: 5,625
|
You're talking about 'fouc' - flash of unstyled content. It can happen in ie/windows when a site uses the @import command to load the stylesheet. There is an easy hack for it (which I can't remember exactly - something about linking to another linked stylesheet or something...), but the easiest solution is in the article below: For those that can't be arsed reading the article, here's the best fix: [quote:1101c74661]The LINK element solution The addition of a LINK element to the basic HEAD element is probably the most natural solution to the FOUC problem. This is because almost every page can benefit from the addition of either an alternate stylesheet or a media-dependent stylesheet. I recommend this solution, because it both prevents the FOUC display quirk and improves the page in some other way: either usability, accessibility, or some other fancy buzzword. Of course, this solution works even if the added LINK element refers to an empty stylesheet. But what a waste that would be.[/quote:1101c74661] |
|
|
|
#3 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,236
|
I didn't follow the link so I might be teaching a cow to chew grass by now but I do it this way... Link to a stylesheet... <link rel="stylesheet" type="text/css" href="screen.css" /> All screen.css contains is... @import url("style.css"); Style.css then contains all your actual styles. You can import as many stylesheets as you need within screen.css. That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
![]() |