Forum Moderators: mack
Please note that URL drops are not allowed at WebmasterWorld, so remove it ASAP or it will get removed by a mod.
A doc-type declaration is a tag which you put on the top of your page/pages for it to validate as a valid XHTML/HTML document.
More information can be found here [google.com] - just look through the sites.
Sid
The only thing a doctype will do is trigger non quirks rendering in Internet Explorer 6, but that has to be the full doctype, the two line one, with the url in it.
If you don't use a doctype your pages will render in quirks mode, all that means is that you won't get any surprises.
Check your pages on a few browsers, like opera, and www.mozilla.org and you will be fine.
Saying your page is a valid doctype when it doesn't contain valid html is pointless.
I was always led to believe that not giving a page a doctype was very bad.
Isn't it better to have a doctype anyway, whether a page validates or not? Obviously the goal is to write valid code, but what about if you are working with 100s of pages which don't validate, and you haven't got a spare ten years to run them all through the validator?
Having said that, you should make every effort to ensure your page is valid as it tends to improve cross-browser display, avoids confusing spiders and helps to future-proof the page.
declares which version of html you are attempting to write your page in
The problem comes when the person or program inserting that doctype doesn't know what the differences are between html versions, which is most of the time. It makes sense to use it if you have some idea of what that doctype supports and what it doesn't support, like closing all tags, upper/lower case html, frames, targets, type etc.
You can get this idea by creating a single valid page using the w3c html validator, then from that you can sort of tell what your actual HTML is, sort of anyway. This will at least tell you roughly what doctype your documents are closest to.
I'm not sure how browsers make these determinations, since most pages are just straight html, I'd guess they pretty much apply all the lowest common denominator for all the rules to a page, sort of anyway.