• Sign In

Life, love, and Technology?

A site for testing the new tools I'm building, and a little talk about what I'm learning on the way. 

  • Home
  • Life
  • Contact
  • JavascriptJavascript Effects
  • My Videos
« Converting to SQLite and LIKE Query Opti...
Javascript Transition Effects »

Internet Explorer CSS File Size Limit

africa » gambia » fajara
Friday, January 25, 2008

Today I encountered a problem where in IE7 and IE6 it appeared as if some parts of my CSS style was not loading.  I tracked the problem down to what appears to be a file size limit of ~288kb for .css files.  In IE only the first 288kb in a file will be read and processed.  Any CSS after 288kb will be ignored. 

In this particular case I was loaded a CSS file of 347kb. 

Firefox does not seem to have a limit. 

The limit appears to be a "per file" limit.  You can split the CSS into two files and it will work fine. 

You may be asking yourself, why would you ever have a CSS file which is 347kb?  Good question... but we use a large file size in our site design application at http://rhythmwebdesign.com   The CSS ends up being gzipped and is only 35kb when you download it when loading the designer. 

 
Comments
 
There are 3 comments - add your comment
Lamin Barrow - Fajara, Gambia
Saturday, January 26, 2008 1:49 AM
Ops!! That does not sound very good for us. But am am sure you'll find a way around it.
PlNG - Long Island, New York
Thursday, June 12, 2008 11:59 AM
I went to try and test this, and I must have done it wrong.
Yet my test yielded yet a different but still important result, so it seems I have encountered yet a third limitation to CSS in IE (first one I read about on the web was @import being 32 max declarations per sheet and nested 3 deep max, 2nd is this one).
I'm not sure if this is specific to the situation, but it seems like IE will only allow a selector to be declared 4096 times (or 1024*4)
I did the test by declaring "#i{color:#000000;}" and incrementing color by 20 for each line to account for each character / byte [Windows CRLF is 2 characters]. I then made a test element with the same ID on the test page, and placed an onload alert event pointing to a function that returns document.getElementById("i").currentStyle.color;
Thinking about this while I typed this comment, my stylesheet is extremely sparse and hits 80k. Perhaps you too hit the 4096 declarations limit?
Marco J Rossi - Manila, Philippines
Wednesday, July 09, 2008 11:30 PM
I agree. I read in the MSDN website that when adding CSS rules in a style object by JavaScript, after the 4096th rule, Internet Explorer will display and exception error and the should-be-added rule will not be added. I think that is the reason why some web developers thought that there is a file size limit on a CSS file -- I would rather test later with more than 300k CSS file and just about a hundred rules, so that I could find out if there is no really a file size limit in a CSS file.

Furthermore, I had just tested having more than 32 styles in a web page and have it viewed in IE; only the first 32 are processed by the browser. The rest are ignored. So is the @import. Firefox and other browsers do not have such limits.

That's why I hate Internet Explorer. I love Firefox (hope this is not a spam).

Your Comment

Your Name
Your Location
To receive emails create a username or Sign In
Your Email
Username
Password
Confirm Password
Add me to the contact list.
Remember me on this computer.
Sign in below or Sign Up
Username
Password
loading...  Post Comment
 
Related Topics
css, ie6, ie7, site designer
Provided By
Joshua
Media Actions
0
Promote
Email to a friend
Enquire
Save to delicious
Digg this
Stumble it
See Also
  • Javascript Transition Effects
  • Libyan Envoy Hails Gambia-Libya Relations
  • KHARAFI CLARIFIES
  • Drop down or flyout menu support added
  • Sony Ericsson W960i & Sony W910i - The Walkman War

Try .geographical media!

Build your own website with .geographical media.  A powerful content management system with easy and fun to use design tools. 

This website is built with .geographical media. 

Visit http://geographicalmedia.org to learn more.

Subscribe Now

Recent Posts

  • Travelling again...
  • Chaos in the Morning
  • Create Your Own Website with Geographical Media
  • Ultimate Frisbee in Gambia
  • One of the reasons I live in The Gambia
  • Converting to SQLite and LIKE Query Optimization
  • Internet Explorer CSS File Size Limit
  • Javascript Transition Effects
  • What am I up to?
  • New Version of our Software

Blog Roll

  • .geographical media
  • joshtracker.blogspot.com
  • laminbarrow.com
  • mela.geo.gm
  • gambiainfo.gm
  • wow.gm
  • africanphotos.gm
  • perina.com
Site created with .geographical media