Welcome to MSDN Blogs Sign in | Join | Help

DOCTYPE switch and web design

A lot of people don’t know that the DOCTYPE switch in your web page can have a profound impact on how your page layout works. For example, the CSS Box Model will look different in WinIE 6 depending on the DOCTYPE switch. If you are doing web design today, make sure the browser you are targeting is not rendering in quirk mode.

Here is a great table of all the different effects DOCTYPE switch has on some different browsers.

Published Thursday, February 19, 2004 5:35 PM by omars
Filed under:

Comments

# re: DOCTYPE switch and web design

Thursday, February 19, 2004 4:13 PM by Mario Goebbels
Good info. I always assumed Trident renders HTML the same, DOCTYPE or not.

# re: DOCTYPE switch and web design

Friday, February 20, 2004 5:44 AM by Mario Goebbels
Just had to think of it this morning:

Assuming a proper DOCTYPE makes IE render standards-compliant (as claimed on the site you linked the table from), I take it that most people complaining about IE being non-standard et al are using DOCTYPEs in their code that make the browser run in quirk mode?

# re: DOCTYPE switch and web design

Friday, February 20, 2004 9:25 AM by Omar Shahine
Yes, that has been my experience.

I spent a lot of time working on a standards compliant theme for dasBlog. Not having IE in standards compliant mode made it impossible to get my pages to render in IE, MacIE, Safari, and Firefox.

# re: DOCTYPE switch and web design

Sunday, February 22, 2004 10:43 PM by Jeremy
Even in standards compliant mode, there are still rendering errors in IE (as well as Firefox). Unfortunately, this solution isn't the end all of problems with IE rendering.

# re: DOCTYPE switch and web design

Monday, February 23, 2004 11:39 AM by Umberto Malandrucco
I have to test your interesting tip but your site uses a doctype marked as "quirk" in the table!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
Infact this page renders bad in FireFox I'm currently using...

# re: DOCTYPE switch and web design

Friday, June 25, 2004 5:01 AM by Ruggero Dambra
I casually realized a strange behaviour of Firefox 0.8/9 about DOCTYPE.
If the doctype tag is absent in my document everything works.
If it's present there'a visualization problem on a table (an alignment error of a cell) and a javascript can't access a W3C DOM paddingTop property

# Omar Shahine s WebLog DOCTYPE switch and web design | Paid Surveys

# Omar Shahine s WebLog DOCTYPE switch and web design | work from home

New Comments to this post are disabled
 
Page view tracker