tags:

views:

51

answers:

2

what is the max number css rules I can specify in style sheet per browser.

A: 

Are you talking about how many css includes you can do? IE does have a maximum of 32 (source) or maybe 31.

However it sounds like you are asking if there is a maximum amount of styles you can include in a single .css file, and I am not aware of any limit in that respect.

rosscj2533
+3  A: 

There's no official limit for any browser, but Internet Explorer has a couple of "unofficial" limits:

  • Maximum number of external stylesheets per page is 32,
  • Maximum number of rules per stylesheet is reportedly 4096.

I'm not aware of any limits in other browsers, but in theory a very large file could cause issues in any of them.

Various sources:

http://simple.procoding.net/2009/02/20/internet-explorer-limits-number-of-external-css-files-to-32/
http://joshua.perina.com/africa/gambia/fajara/post/internet-explorer-css-file-size-limit
http://am-blog.no-ip.org/BlogEngine/post/2010/03/24/CSS-File-Size-Limit-in-Internet-Explorer-6-7-8.aspx

Andy E
+1, never knew about the max rules per stylesheet issue.
rosscj2533
Thanks @Andy, This is really helpful.
An Object