Fix: CSS Problems in IE 8 With Over 31 StyleSheets
In my latest Web application, I went crazy trying to find out why a popup/overlay window style was acting up in IE 8 but was fine in the latest version of FireFox. After too many hours of frustration and dead ends, I took the issue to my friends at Telerik Support (the site I’m developing uses their excellent RadControls for ASP.NET AJAX suite).
Telerik diagnosed the problem immediately as too many stylesheets for Internet Explorer to handle. Huh?
I didn’t know about this limit (bug) of 31 stylesheets - but even if I had, I’d have wagered that I didn’t have that many. It turns out that many 3rd party controls generate styles as resources using an httphandler in the web.config file. Worse, even HTML style tags count as stylesheets to IE!
In my case, the solution was to add Telerik’s RadStyleSheetManager control to my master page. Suddenly, the troublesome style issue was gone.
From what I read on the InterWeb, Microsoft doesn’t plan to do anything about this limitation in IE 9, so it’s going to be around for a long while. You think Internet Explorer would at least give us a helpful error message such as “Sorry, there are too many stylesheets for me to handle. The page probably looks weird because I’m a wimp and have given up applying the excess styles.”
For more info on the issue, check out this blog post on Internet Explorer CSS limits:
http://blogs.telerik.com/kamenbundev/posts/10-05-03/internet_explorer_css_limits.aspx
Full Disclosure: As a Microsoft MVP for ASP.NET, Telerik gives me a free licence to its control suite.
Ken