How Long is your IE Stylesheet?
Here’s an interesting question. I guess we’ve all got different tolerance levels and methodologies based around Internet Explorer - sheer economics precludes a full day’s investigation of every cross browser issue for some businesses. So how many lines does your current IE stylesheet have?
For anyone who doesn’t know what I’m alluding to, its when we use conditional comments to target Internet Explorer (either en-masse or by version) to fix those lovely little anomolies we’ve grown to love in our own special industry fashion. Using conditional comments is a far superior way to dealing with these bugs than the dark and soul-degrading option of CSS Hacks. IE7 saw a few CSS Hacks come back to bite high profile standardistas when sites suddenly fell apart because several exploited browser bugs were fixed.
So how many lines are in your IE stylesheets? For example, on this site, although admittedly its a reasonably simple layout, my current IE6.css file has 14 lines of which 8 are selectors and declarations. The likely suspects in my IE6.css file use width, padding and a font-size for code. I’m of the mind to use this stylesheet sparingly after all measure of enquiry (or a sudden time crisis) has led me to no other alternative. I also only place the very exact rule that needs to go into that IE6 fix. As yet I haven’t had to utilise an IE7.css file.
I’m not sure how others approach this method of branching your CSS files but I’m sure some people have 300 lines in these alternate stylesheets (because I’ve seen them). It can be tempting the moment you find an anomoly to just put in that fix every single time into the IE6 sheet and forget about it. The real concern with over-using this as an easy escape route from cross browser issues comes back to maintainability and turning it into an entire code fork. That’s not ideal in either case. Ultimately, in my view, we’re talking a method of last resort. Most things can be fixed, worked around or reasonably tolerated. The IE6.css file just makes my life a little less stressful.








June 25th, 2008 at 3:07 pm
Not that many, to be honest. Mostly to fix a margin here or there, or to undo some fancy positioning or transparencies that other browsers display fine but IE6 doesn’t. I usually just make those relative and most of the time that’s ok. I don’t believe sites should look or behave exactly the same in every browser as long as they remain usable and visitors can do what they’re supposed to.
On average I’d say less than 20 lines. IE7 is much better behaved, but still requires a few lines from time to time.
June 25th, 2008 at 8:52 pm
Yes its interesting, until recently I never realised that some might be out there seeing this as an entire code forking expedition while many of us realise its a last resort tool for special occasions. I’d just presumed that everyone got that part.
BTW, as I haven’t run into any IE7 issues yet that couldn’t be flossed over - any tips on IE7 fixes would be handy. What rules have you got in that one? Just curious (they’re bound to get me in the end).
June 26th, 2008 at 2:02 pm
Most times I don’t have any issues with IE7 that will require a separate stylesheet, unless I’m using the transitional doctype and even then it’s rare.
It usually is on a case by case basis that I will decide to use one to align an element or change some margin. Because that doesn’t happen very often I haven’t developed any rules for IE7.