IE CSS文件限制

Internet Explorer (IE for short) imposes some CSS file limitations that may directly affect page rendering. Below is a list of known CSS file limitations still found in IE version 9 and earlier.

- Up to 31 CSS files or <style> tags per page. 单个页面最多31个css文件
- Up to 288K per CSS file (uncompressed). 每个css文件大小最大288k
- Up to 4095 selectors per CSS file. 每个css文件最多4095个选择器

If a page exceeds the first limit, it fails loading all the required CSS files. Once a CSS file hits the second or third limit, any additional style in the file will be ignored.

Resource merging, which help you reduce the number of requests made to the server, may bring the following dilemma in IE. If you are not using resource merging, you can pretty easily hit the first limit. On the other hand, if resource merging is enabled you may eventually hit the other two limits. So, to avoid hitting the limits, we recommend that you enable or disable resource merging based on the CSS file structure you are using.

Currently, the solution to automatically manage our CSS files in order to keep them within the limits is not ready yet. We created a corresponding suggestion in our Support Center (Suggestion ID: S35991, In IE, automatically split CSS resources if their size exceeds 288K) so that you can track our progress on it.

The first limitation usually occurs when the <head> tag contains several <link> and <style> tags. A number of linked styles to the page can be got via the document.styleSheets.length property in the JavaScript console. Using the document.styleSheets collection, you will be able to determine what styles are linked to a specific page (e.g. use the FireBug console).

 

 

解决方法:

1.压缩合并css文件

2.css文件中使用@import url(...)     :网上搜索到的,未测试过。。。

 

http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx

Resource Merging http://documentation.devexpress.com/#AspNet/CustomDocument6911

 

转自:http://www.cnblogs.com/fromchaos/archive/2011/08/14/2137723.html

你可能感兴趣的:(css)