0

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.

k-dev
  • 1,657
  • 19
  • 30
  • first check the missing `t` in the first declaration `ype="text/css"`, then check in the viewsource if the paths are being correctly created by the `@url.Content`. Lastly make sure that you do not have overlapping rules, and that you do not use `!important` – Gabriele Petrioli May 19 '11 at 22:14
  • thanks for your ansnwer, but ype was a mistype, path is correct and actually there is no rule applied for elements. Seems that IE is completely ignoring what is written in css file. – k-dev May 19 '11 at 22:27
  • Do the final generated URLs to the style sheets work? – Pekka May 19 '11 at 22:44
  • @pekka well, at least fiddler shows the content, urls looks like this /MySite/Content/page1.css, btw I have the project deployed on IIS – k-dev May 19 '11 at 23:00

1 Answers1

0

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.

Community
  • 1
  • 1
k-dev
  • 1,657
  • 19
  • 30