I have been using dean edwards ie7/8 script. Not sure if it's my implementation or not but sometimes I would experience ie6 issues that weren't quite fixed or required special handling which meant I would be back where I started, caring about ie6. So, I was wondering if ie7/8 is still the go or if some other practice/solution was better.
I don't think there is ever a standard as to what browser you can or can't ignore. It depends on the organization -- or the audience in the case of your start-up. Any JS you write should "gracefully degrade" but making sure that actually happens requires some artfulness at times.
Update: I expanded my answer here with a tutorial on my site, which will probably be more helpful than my answer here. Ultimate IE6 Cheatsheet: How To Fix 25+ Internet Explorer 6 Bugs
Here's how I tackle IE6:
- I validate both my XHTML and CSS.
- I keep my designs simple, even the complicated ones.
- I don't use hacks that invalidate my CSS.
- I use a JavaScript framework/library (I like MooTools, but you'll get a lot of votes for jQuery, Prototype, YUI, Dojo, and many others) that handles most of my cross-browser JavaScript problems.
- I progressively enhance my pages so that they first work without JavaScript and then add all the bells and whistles.
- For some of the double margin problems, I use display:inline;
- If I absolutely have to, I use a separate stylesheet, though I'm finding I have to do this less and less.
- I try to avoid transparent images in my layouts. If I absolutely need them, I use a PNG8 with alpha transparency, which IE6 actually does support.
- To get at the min-height problem, I do the following:
This for IE6, which interprets height as min-height:
.classNameHere {height:300px;}
This for for everything else:
div>div .classNameHere {min-height:300px; height:auto;}
Incidentally, if you need to isolate IE6 with CSS, that's a good way to do it, as it doesn't support child selectors.
To be completely honest, I don't really handle IE6-issues much lately. My design-process is simple:
- Reset margin/padding on everything. I mean everything.
- Test my page layout every few minutes. Takes one tap on F5.
- If any change breaks the page, I stop everything and evaluate the change.
- If the desired method cannot be used, I research alternative methods, excluding 'hacks'.
- I validate both markup and css. And always use XHTML 1.0 Strict.
- I make sure my site works first without Javascript, and then later use jQuery.
These basic practices have kept me from having to work around IE6 issues a lot over the years. The only issue I still get upset over is IE6's support for PNG24 with Transparency, but IEPNGFix takes care of those - usually without breaking my layouts too.
It may be the opinion of a foolish man:
Great developers don't find complaints, they find solutions.
I'm using:
- "Reset.css" to minify the difference between the browsers default CSS computed styles (e.g. YUI reset.css)
- Conditional Comments to put additional css file into the scope ;) (e.g. ./ieFix.css)
- W3C Validator to tell if the difference in rendering is caused by bad nesting or it's just IE ;)
- if that fails, jQuery helps a lot ;)
I agree with the responses that talk about a process involving clean code, conditional comments, keeping ie6 happy but not perfect, etc etc. But it's a very cautious, little by little process which is still, at the heart, quite time consuming when really it's all for one browser. I am reluctant to tick any response as answered because all the responses talk about existing methods I am familiar with. It may be that my question is answered "No" :) because essentially I was after a framework that meant you didn't even have to worry about ie6's nuances, just code in a modern way - something I thought ie7/8's js would do but even just today I realise that min-height isn't being fixed!!. Thanks anyway for the replies - it's helped re-enforce that my approach is still the status quo and I am using my time as efficiently as I can.
There is really just one "fix" for IE-problems which is to help facilitate its suicide. The only way I've discovered to help IE commit suicide is to educate my visitors. This can be done by sniffing the browser and if IE is detected you display a "help upgrade the web" banner.
Kind of like GMail does...
We're doing this at ra-ajax and stacked (visit the site with any versions of IE)
Build for firefox first, nuke or downgrade design elements experience tells you IE6 can't handle at the outset, and not spend more time than the client spec warrants
TBH experience is the #1 preventative measure for IE6 problems
- Make it work in Firefox;
- Check to see if it looks and works the same in IE7;
- Check to see if it sorta works in IE6 (because that's good enough).
- If you can't do the layout with simple CSS (no crazy relative+absolute positioning or float:after fixes) then just do it with tables;
- Put a DOCTYPE in to force the browser into compliance (rather than quirks) mode;
- Minimize box model issues by minimizing the use of contained borders (or by giving invisible borders to other similar elements) and nesting elements to minimize padding/margin/border combos, which will just cause you grief;
- Don't bother trying to get a CSS menu to work across all browsers. It isn't 2003 anymore. Just use Javascript (eg jQuery/superfish).
- Only use :hover on links. If necessary change them with display: block.
- Kill ALL default styling before starting.
- Throw Dean Edwards script at it.
- If problems persist to tell users to upgrade.
- If IE6 is vital, use an IE stylesheet that removes whatever doesn't work and replaces them with less complex styles.
- jQuery :hover etc. to .hover, input[type=submit] to input.submit etc. Helps with older versions of FF and Opera aswell occasionally.
I've decided yesterday to not support it anymore. There's a movement starting trying to kill IE 6.
Thanks to IE's conditional comments it's easy to show a message for just those users.
I build it for Chrome, then I optimize for Firefox most of the time its just little things then I go into IE 8 and then I go into IE 7 since most bugs I will have eliminated by then. After IE 7 I take a brief look at Opera and am finished for the day. Who cares about IE 6 anymore?
Are you complaining to the Intel manufaturers that the cpu doesn't fit into your comodore? There are technology advancements and I think IE 6 should be killed the best way to do that is to tell the the user he has to upgrade and let the site look like crap thats the only way to force them to switch. Some will eventually ask their children why the internets are broken and then the son will come along install all updates and the mom or dad can be happy again.
My answer in short: No more optization at all is how I handle it.