Old 02-05-2003, 08:08   #1 (permalink)
oli
Free Ring Ding™
 
oli's Avatar
 
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 ?
__________________
..................
  Reply With Quote
Old 02-05-2003, 08:39   #2 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
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:

http://www.bluerobot.com/web/css/fouc.asp

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]
  Reply With Quote
Old 02-05-2003, 09:03   #3 (permalink)
smallbeer
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.
  Reply With Quote
Old 02-05-2003, 09:21   #4 (permalink)
oli
Free Ring Ding™
 
oli's Avatar
 
Join Date: Feb 2003
Location: Manchester
Posts: 9,502
ok , thanks
__________________
..................
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8