views:

72

answers:

3

In an answer about CSS, a user said:

Internet Explorer has is said to have a limit of 4096 CSS rules per file. Reference

Also, it has a limit on the number of style sheets you can embed in a single document. I think it is 20.

While the reference on MSDN seems to confirm this (and there's a blog post which confirms this in IE7), is this still the case for IE8?

+1  A: 

This thread suggests there is a limit of 31 CSS references per page/CSS file but that you can achieve more than that by using @import and a nested hierarchy of CSS files.

More info from a Telerik blog on the issue making it clearer that this applies to IE8.

Daniel Renshaw
+3  A: 

Yes, IE8 (and even IE9 apparently) limit the number of style sheets to 31 per page.

Telerik has an article and test page which demonstrate the issue. According to comments in the same article, the 4096 rules per file limitation has been marked as Won't Fix in Microsoft Connect but I've been unable to verify that.

Chris Pebble
Won't fix? Oh well...it seems to be an edge case for MS, and it's a corner case for me. I'll try for some sort of server-side CSS combiner/minifier then.
Piskvor
(I'm aware that combining the files won't help with the "4096 rules" problem, but I'm not about to hit *that* limit, by a long stretch)
Piskvor
Microsoft say the don't plan to fix this here: https://connect.microsoft.com/IE/feedback/details/542903/ie9-platform-preview-does-not-load-more-than-4095-css-selectors-on-a-page
Ju9OR
+1  A: 

Microsoft claims the limit is 30, but the limit is apparently 31 according to Telerik. The Telerik blog also mentions a 4095 selectors per file limit.

Ju9OR