views:

78

answers:

3

I am working on a project which requires IE6 compatibility. Unfortunately, IE6 and IE7 do not support standards mode. Because of this, I am tempted target almost standards in for all browsers and just ignore standards mode completely, so that I am only targeting browsers running in the same standards mode. I figure that because XHTML transitional is so popular, almost standards most is guaranteed to be supported for a long time to come. Is this a good idea?

+5  A: 

No, this is not a good idea.

Its not a good idea because eventually IE6 will be obsolete (sooner rather than later) and you will have a messed up site where you have to jump through hoops to get it to look halfway decent.

A better solution is to use progressive enhancement, in a nutshell support the minimum you need for IE6 and give the modern standards following browsers the goodies.

With progressive enhancement you still get your support for IE6 but you're left with a standards based website that is easier to maintain and develop further.

Darko Z
@Darko: I rechecked wiki and found out that it is actually IE 6 and 7 that don't support standards mode. I think that will take a long time for it to become obselete for our enterprise customers. BTW, I am considering using almost standards mode rather than quirks mode
Casebash
IE7 while not perfect is still vastly better than IE6. My advice still stands however, as in my experience PE is the best strategy to deal with older browsers regardless of what they are. Regarding "Almost standards mode", I believe that only exists in Firefox. I'm not aware of other browsers having a third mode, nor of a DOCTYPE that would render it. It seems that "A" in that table you link to denotes that standards are not fully supported, hence almost standard.
Darko Z
According to the article, the criterion used for "almost standards mode" is "non-standard table cell height rendering". This was originally the only difference between almost standards and standards mode, but as mentioned [here](http://stackoverflow.com/questions/1414872/how-does-almost-standards-mode-change-rendering-from-standards-mode/1414915#1414915), other browsers may have other differences between the modes.
Casebash
OK lets say you will use almost standards mode - what will your DOCTYPE declaration look like?
Darko Z
If I use XHTML: `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">`, if I use HTML: `<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">`
Casebash
Agreeing with Darko here, there is no such thing as "Almost-Standards Mode". It simply means "browser tries to act according to standards, but gets it wrong (i.e. has bugs)". The alternative, Quirks Mode, pretty much means "browser doesn't even try to get it right, and has bugs". Which one is worse?
deceze
Right now I get you, you're talking about transitional/loose vs strict doctypes. in that case, do as you will :) i've done my share of both - strict is a bit harder to maintain but in general better practice :)
Darko Z
To clarify strict forces you to really think and I find that it benefits not just the site but my own skill development - transitional is definitly easier to deal with. It'll probably come down to whether the features you need clash with the strict doctype, in other words pragmatism wins.
Darko Z
@Darko: Transitional will render in "almost standards" mode in almost all browsers. Unfortunately, strict vs. transitional and quirks vs. almost standards vs. standards are not on completely seperate axis. You have to decide which combination you'd prefer first and then see if there is a doctype that will get you that on your range of targeted browsers.
Casebash
@Casebash its only that complicated if you're looking at supporting a large range of obsolete browsers (unfortunately IE6+7 aren't obsolete yet) if IE6 is the oldest/worst browser you have to support, your decision should be fairly simple. Do any of the must have features not work in strict mode in IE6 and IE7? No => use strict, Yes => use trans. For the rendering differences use progressive enhancement
Darko Z
+5  A: 

Using "almost standards" mode is dumbing down other browsers for the sake of IE. IE6/7 doesn't support a standards mode because it's incompetent. You should never write markup aiming at incompetence. Write modern markup with a strict doctype and use "conditional comments" to hack and beat IE into the best compliance you can get out of that thing or you will be doomed to a world of darkness and hurt.

Rob
+1 Well put. :)
deceze
I would tend to agree, strict will always trump all others - but there are cases when you just need to be pragmatic. But always try your hardest with strict first :)
Darko Z
+2  A: 

Roughly 40% of the user base of my company's software uses IE6 (down from ~60% a couple years ago).

Our master pages have the XHTML 1.1 doctype set. I do all my design work using the latest version of Firefox and then once I have it all working how I want, I test in IE6 using the App Compatibility VMs for Virtual PC that MS releases, and make any necessary changes to my CSS that IE6 requires.

Most of the time I can just use slightly different CSS and don't have to resort to hacks, although sometimes I still do. But the hacks don't affect other browsers, since they're IE6 specific. I haven't gone to the length of using browser-specific CSS files yet, cause the extent of my IE6 hacks are something on the order of 10 lines out of ~1500 lines of CSS. My modified CSS to "support" IE6 still renders fully standards-compliant in Firefox.

EDIT: thanks to Rob's comment I'll be changing my doctype to "HTML 4.01 Strict with system identifier" (provided testing shows that it doesn't break anything). That Quirks Mode chart on Wikipedia shows my current doctype (XHTML 1.1 with system identifier and without XML declaration) results in the same render modes.

Everything I said above still applies, though. I code for standards-compliance in the latest version of Firefox (the Web Developer add-on is my friend) and then "make IE work" without breaking standards-compliance in Firefox.

sliderhouserules
Please note that the XHTML1.1 doctype is an XML application and must be served as application/xhtml+xml. Since IE does not recognize XHTML served as XHTML, I presume you are not doing so and should only be using the XHTML1.0 doctype.
Rob
I wasn't aware of this so thank you for enlightening me. The XHTML 1.1 doctype I'm using results in the same rendering modes as the HTML 4.01 Strict with system identifier on that Quirks Mode chart. So I'll be looking to change to that doctype.
sliderhouserules