Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
CSS - Empty IE conditional improves performance
Old 10-20-2011, 08:44 PM CSS - Empty IE conditional improves performance
TWD
TWD's Avatar
King Spam Talker

Posts: 1,183
Trades: 0
Came across this article this morning.

Conditional comments block downloads / Stoyan's phpied.com

Reading through it, the key takeaway is that placing an empty
conditional IE statement at the top of your page eliminates a bottleneck
in CSS style sheet processing when there are IE6 and IE7 style sheet references later on the page.

So best practice would seem to go something like this:

Code:
<!DOCTYPE html>

<!--[if IE]><![endif]-->

<html lang="en">

<head>

    <title>base page</title>

    <link type="text/css" rel="stylesheet"
          href="http://tools.w3clubs.com/pagr/1.expires.css">

    <!--[if IE 6]>
        <link type="text/css" rel="stylesheet"
              href="http://tools.w3clubs.com/pagr/2.expires.css">
    <![endif]-->

    <!--[if IE 7]>
        <link type="text/css" rel="stylesheet"
              href="http://tools.w3clubs.com/pagr/3.expires.css">
    <![endif]-->

</head>

<body>
The content of the document......
</body>

</html>

In the comments to this post, it was also suggested that if
you are using @import for loading your style sheet, you might want
to try adding an empty <link> element like this:

Code:
<!--[if IE]><link/><![endif]-->
as it additionally fixes the @import FOUC problem well known to exist in IE

Flash of Unstyled Content (FOUC)



Anyone doing this? Comments?
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE
TWD is online now
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-21-2011, 10:09 AM Re: CSS - Empty IE conditional improves performance
Average Talker

Posts: 17
Trades: 0
On the FOUC page, it gives as solution to add a <link>:

Quote:
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" media="print" href="print.css">
<style type="text/css" media="screen">@import "style.css";</style>
</head>
But why use @import at all? Why not just do it like this:
Code:
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
?
__________________
Frank

Please report back how suggestions worked out.
FrankknarF is offline
Reply With Quote
View Public Profile
 
Old 10-21-2011, 11:12 AM Re: CSS - Empty IE conditional improves performance
TWD
TWD's Avatar
King Spam Talker

Posts: 1,183
Trades: 0
Good question.

I believe some people like to "chain" CSS style sheets to a master CSS.

http://webdesign.about.com/od/advanc..._at_import.htm
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE

Last edited by TWD; 10-21-2011 at 11:14 AM..
TWD is online now
Reply With Quote
View Public Profile
 
Old 10-21-2011, 12:15 PM Re: CSS - Empty IE conditional improves performance
Average Talker

Posts: 17
Trades: 0
OK, but under normal circumstances, I really wouldn't know why one would want to divide the CSS basics, typography, colors and layout over 4 style sheets, and have those imported by one main style sheet.
FrankknarF is offline
Reply With Quote
View Public Profile
 
Old 10-21-2011, 02:20 PM Re: CSS - Empty IE conditional improves performance
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Interesting. Totally new to me, but something that's worth investigating.

The @import is more used in a single css file to manage other css files. It can keep things a little cleaner and make it easy to swap out one set of css rules for another. I think it's always had performance issues though.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to CSS - Empty IE conditional improves performance
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18389 seconds with 12 queries