Last year, Article 4 of the restriction in " IE Limitations and Solutions to CSS Style Sheets " was summarized: "A CSS file cannot exceed 288kb?" This was a question that was not reproduced at the time and the reference came from Internet Explorer. CSS File Size Limit. Today I finally saw another limitation of IE on CSS: the number of selectors for each style tag or css file in IE cannot exceed 4095. In fact, the style attribute should also have this restriction, but it is almost impossible to happen. This limitation exists in IE6, IE7 and IE8. Please see IE's DEMO about the 4095 selector limit .
Style.css in DEMO has 4913 selectors and a size of 554kb, but in IE it fails after 4095 selectors, so it means that IE's CSS file does not have a limit of 288kb.
Therefore, you may encounter this limitation when using the addRule method and the cssText attribute to add styles to the style tag in IE. For example, when using the addRule method to add the 4096th selector, an " Invalid Argument " exception will be reported.