简体   繁体   中英

css files rules are not being applied in IE 8,9 and they work on firefox

First of all, this only happens on IE, in firefox 3.6 everything works well, I have a lot of css files referenced in my pages as follow

<head>
   <link href="@Url.Content("~/Content/layout.css")" rel="stylesheet" type="text/css" />  
   <link href="@Url.Content("~/Content/page1.css")" rel="stylesheet" type="text/css" />    
   <link href="@Url.Content("~/Content/page2.css")" rel="stylesheet" type="text/css" />  
</head>

css rules in page2 are not being applied, if I change the order, for example layout, page2, page1 then page1's rules are ignored. Any ideas?

I am referencing all css in my layout to have them separately during development and put them together and compress it during deployment, I have currently around 30 css, Could be that the problem?

note: css are being downloaded, I check them with fiddler, for some reason IE is ignoring my rules, besides it works perfectly on firefox.

Edit

Another clue, I noticed that if I remove a previous link reference in page, all begins to work, so, I thought it was something wrong with that previous file, I went to that file, put everything between /* */ add the reference again, and everything got broken.

This is incredible, I found the issue, IE has a limit of stylesheets per page as pointed out in this question Does IE 8 have a limit on number of stylesheets per page?

I know, I know, how is 31 stylesheets possible, I have them separately during development for each page to compress and join them later at production, of course I need to do something else now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM