52

I'm using Drupal and I notice that if I have my CSS files aggregated that the CSS doesn't always work correctly. I know there is a problem in IE7 but is there a limit to a CSS file size in IE9?

Community
  • 1
  • 1
Paul Sheldrake
  • 7,505
  • 10
  • 38
  • 50

1 Answers1

103

There are 3 limits:

Microsoft support/MSDN reference links:

http://support.microsoft.com/kb/262161

http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/internet-explorer-stylesheet-rule-selector-import-sheet-limit-maximum.aspx

theDmi
  • 17,546
  • 6
  • 71
  • 138
Paul Sheldrake
  • 7,505
  • 10
  • 38
  • 50
  • 17
    To notice, IE10 doesn't have this limit (including when in IE7-8-9 modes) – Evgenyt Dec 06 '12 at 14:24
  • 11
    there's a ~288kb file max too. Info: http://joshua.perina.com/africa/gambia/fajara/post/internet-explorer-css-file-size-limit – RaphaelDDL May 24 '13 at 21:03
  • 1
    @RaphaelDDL I don't think that link should be taken at face value. I regularly see larger files. The link author probably hit the selector limit. – noah Jul 03 '13 at 16:07
  • @noah I've had cases files around that size have failed while still being below the other limits. Splitting into multiple files fixed the problem so it's worth checking out. – Andrew Pietsch Jan 10 '14 at 11:05
  • 1
    In my testing of IE9 I found the MAX SIZE to be 278kb – David Barlow Dec 16 '14 at 03:14
  • I've seen other people mention the 278kb limit as well https://gist.github.com/psebborn/1885511#comment-1383451 – Daniel Apt Mar 12 '15 at 10:53
  • I'm on the low side, but I'm getting the behaviour at 270KB – Josh Robinson Sep 22 '15 at 14:38
  • For a silly guess, I'm going to say anything greater than 256 (the 8th power of two) might be the limit. If the file was loaded into a single byte field, that might be the issue. The next size up is 1024.. I haven't seen anything there. – Josh Robinson Sep 22 '15 at 14:52
  • I could not find any evidence for a 288KB limit. See https://stackoverflow.com/questions/49683077/is-there-a-css-file-size-limit-in-ie9/49784811#49784811 – Arya Apr 11 '18 at 21:41