Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Internet Explorer simply stop parsing in the middle of my CSS?

Tags:

html

css

I help manage a website for a local ACM student chapter, http://acm.cs.uakron.edu/.

For some reason, Internet Explorer simply refuses to parse the majority of the CSS. Every other browser I know of handles it just fine, but why does IE7+ stop?

like image 694
Trever Fischer Avatar asked Dec 09 '22 13:12

Trever Fischer


2 Answers

The comments say you have 35 CSS files. That in itself, in addition to just being a lot of requests, is enough to be a showstopper for IE.

According to Microsoft Knowledge Base Article 262161,

All style tags after the first 31 style tags are not applied.

This applies to all versions of IE so far, including the IE9 beta. Ouch. Time to merge those stylesheets into one file.

When handling big complex CSS projects like that, I usually recommend using a CSS pre-processor like Sass, and turning those smaller stylesheets into includes pulled into the larger stylesheet that is fed to the browser. Almost everyone has a different solution to this particular issue, though.

like image 192
Matchu Avatar answered Jan 12 '23 00:01

Matchu


Internet Explorer can not parse any more than 31 CSS files wether embedded or not. Even if you use the @import css syntax IE will ignore everything after 31 files! How crap is that?

try http://sourceforge.net/projects/cssmerge/

like image 20
Gary Willoughby Avatar answered Jan 11 '23 22:01

Gary Willoughby