Page is a not externally linkable
- Code, Content, and Presentation
-- HTML
---- Do I REALLY need a DOCTYPES, on my websites?


createErrorMsg - 4:25 am on Mar 13, 2005 (gmt 0)


Just want to bring these issues to awareness for everyone reading along at home.

To add to this...

A lot of people seem to think that the only rendering difference when a doctype is applied is in which box model the browser uses. They conclude, then, that if their site uses tables for layout or otherwise avoids box model issues that there will be no difference in rendering. This is simply not true.

The doctype specifies LOTS of things, an important one being how box calculations are made, yes, but that's only one peice of the document. I have seen wild variations in the same page between browsers when no doctype is involved. Margins and padding are handled in seemingly random ways on some browsers without a doctype. Flagrant breaches of the W3 specs are rendered willy-nilly, making cross-browser uniformity a pipe-dream, and even worse, tricking coders into thinking that bad code isn't (and that bad browsers aren't). In just the past few days I've posted to three or four threads in the CSS forum where a lack of a doctype was causing the designer to get rendering problems.

If you think for a moment about what a doctype IS, it's easy to see the logic behind always using one. A doctype is a set of rules that tells your browser how to handle interactions between various peices of code. It just makes good sense to ensure that the rules you are designing according to are also the rules the browser will interpret according to.

You should always use a doctype declaration.

cEM


Thread source:: http://www.webmasterworld.com/html/9844.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com