charco
02-22-2005, 02:04 AM
I have been recentoly told that I must have a doctype statement before the <html> tag. Is this true? and if so what sort of doctype should I use for a site built using Dreamweaver with templates having html, Javascript, and some flash animations.
Does each page need the same doctype?
Cheers
Faglork
02-22-2005, 03:00 AM
You find the answers all at
http://hsivonen.iki.fi/doctype/
a more descriptive overview of doctypes:
http://www.w3schools.com/tags/tag_doctype.asp
Some doctypes send IE 6 into quirks mode, which means that it will apply the broken box model of IE5. If that happens, you need to apply the dreaded "box model hack" for IE5 in your CSS.
If you dont know what this all means, just google for "broken box model"
A DTD is also needed for validation, which gives you an easy way to write correct code: just use a validator. Most "strange design effects" and "browser differencies" are caused by faulty code, which can easily be avoided by validation.
A DTD can even make a difference between getting displayed or not: Some browsers on mobile devices simply dont display content which doesnt have a DTD or a wrong one. With my Nokia cell phone (for example) I can easily surf any (accessible) page, as long as its got a valid XHTML DTD.
A hint: If you go XHTML, do not use the XML prlogue. It is not required, but will send IE6 into quirks mode. (Did I already tell that I hate that crappy piece of software? Hopefully, IE 7 will be at least a bit more compliant.)
Alex