HTML 4 Transitional Doctype and Cross-browser Compatibility

  • 7th October 2004
  • with Comments off for HTML 4 Transitional Doctype and Cross-browser Compatibility
  • Filed Under: Weblog
  • tagged with: web standards, css, xhtml, opera, ie

I've never had to monkey with HTML 4 Transitional doctypes before but the project I've just finished required it and it's brought home exactly WHY I've never done it before.

Having the HTML 4 doctype without the URL declaration throws IE6 into quirks mode so it behaves like IE5.5 in terms of box model and hacks/filters... Not such a bad thing in the short term - at least it allowed me to keep my box model hacks simple (* html all the way), but it was only when I came to test in Opera that things got complicated. IE6 is in quirks without the URL and Opera is in quirks too. Fine. But Opera doesn't fall for the * html hack so it doesn't get fed the old box model dimensions. In fact I couldn't find ANY sensible way of filtering Opera from Mozilla at all so Opera was stuck with W3C box model figures. That's it. As far as I can tell, using the HTML 4 Transitional doctype makes it impossible to produce good cross-browser pages. This is hardly earth-shattering but I'd never thought about it before.

  • Comments off for HTML 4 Transitional Doctype and Cross-browser Compatibility