IE conditional comments slow down page loading?

I have recently had enough CSS hacks and Conditional comments arguments that I thought I would post this question to the community.

<!--[if IE]>
 <link type="text/css" rel="stylesheet" href="ie-specific.css" /> 
<![endif]-->

The main argument against using conditional IE comments seems to be that you add extra HTTP requests to each pageload, which slows down the display of your page. What I could not find are any real indicators that prove or disprove this statement.

Leaving aside the argument of serving multiple stylesheets against one stylesheet (although this is a proper discussion in itself), someone here did some testing to determine how much the use of conditional comments is slowing down, or able to point me aside any statistics that anyone else has collected?

+3
source share
1 answer

Actually, this is not only about conditional comments, it is like conditional compilation.

IE will display your page with inclusion in IE browser

<link type="text/css" rel="stylesheet" href="ie-specific.css" /> 

(with a little extra processing to evaluate the comment condition).

In a browser other than IE, you will see a comment there.

, - , IE ( ), CSS. , , .

, IE () 5Kb CSS , () 2Kb "" , 5Kb; vs 7Kb CSS . , , , , .., IE (, , , IE).

, , , , , IE, , , "" CSS , IE .

+7

Source: https://habr.com/ru/post/1724372/


All Articles