Internet Explorer issue - maximum of 32 CSS @import
March 11, 2008 on 7:11 pm | In General |To be honest, I just ran into an issue that I thought was fairly ridiculous.
Internet Explorer restricts you to a maximum of 32 @import statements in your CSS file.
For the less advanced developers, you can import another CSS file from within one of your CSS files. Consider it like a #include in C programming, or an include statement in PHP. The syntax would look like this:
@import url("mystyle.css");
When you are developing a complex web application, you are likely to have many CSS files. Admittedly, we haven’t cleaned up the CSS structure and removed any outdated CSS stylings for a while, in our project. We shouldn’t have imported so many. But it struck me as ridiculous for Internet Explorer having such limits. (Needless to say, Firefox has no such ridiculous limits.) To me, it just seems like a programming flaw (using a 5-bit number as indexing for imported files?).
Reference: http://www.juniper.net/security/auto/vulnerabilities/vuln3394.html (the topic discussed in this link is not related, but pay attention to the end of the second paragraph: “Internet Explorer imposes a maximum limit of 32 imports that an individual styleSheet object can hold, and a depth limit of three on the number of style sheets that may be included within the style sheet chain.”)
Update (3/27/08): Apparently, IE doesn’t only impose a number of files limit — but even a file size limit for each CSS file. The IE CSS file size limit seems to be ~288kb. Again, Firefox doesn’t seem to have such limits. Way to go IE, for continuing screwing web developers up.
4 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
You must be logged in to post a comment.
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
Save in del.icio.us
StumbleUpon this
Very nice info your posting on this blog, I’ve bookmarked it and will be checking back regularly
Comment by maclof — March 15, 2008 #
Thanks for the comment maclof! It’s encouraging to read comments like yours. As always, I’ll keep writing articles that I think could bring new information and be useful for other developers.
Comment by Bigi — March 16, 2008 #
I’d love to see some kind of extension to your previous PHP MVC posts. I’ve always found my code gets messy when deciding what method to use to lay out my files, should they access each .php file seperately? or use some kind of GET variable.
Comment by maclof — March 18, 2008 #
I have been working more deeply in JavaScript and more frontend things lately, so there are actually a couple more topics I’d like to be covering in that area.
However, after that, I’ll definitely revisit PHP with MVC again. I also noticed that in my traffic stats, that particular one was a popular article. Good to hear feedback directly from the audience.
In addition, I have also learned much myself ever since I’ve written that article, which is almost a year ago by now. I do have a lot more things to share about it!
Comment by Bigi — March 21, 2008 #