David Dyer-Bennet wrote: >Bryan Newell <bryann at bryann.net> writes on 22 February 2004 at 23:33:55 -0600 > > > I hadn't realized that was a fatal error... It certainly isn't fatal in any > > of the browsers I've used. Is that only required so the validator knows HOW > > to validate your html? Or are browsers also supposed to reject your page if > > it doesn't have a DOCTYPE declared? > > > > Anyone know? > >I've never had a browser complain about lack of DOCTYPE, or character >encoding. The validator is absolutely insistent on both, however. I >don't know if it helps them validate, or if it's just a requirement in >the spec that no browser enforces, however. > > There is fatal and there is *right*. The spec says that the document should have a doc type. Some browsers do react differently depending on whether there is a doctype. For example whether the page should be rendered correctly or in 'quirky' mode (ie not confirming to standards) [http://www.upsdell.com/BrowserNews/res_doctype.htm]. The gecko browsers actually go so far as to render the page differently depending on which doctype you declare [http://mozilla.org/docs/web-developer/quirks/doctypes.html]. So in answer. It is a requirement in the spec. Browsers won't complain just as they don't complain when you leave end tags off tables or paragraphs - they are created to deal with badly written code. However it does have an effect on how modern browsers render the page and it may become even more important in the future when the next generations of browsers start doing really interesting stuff. :-) Fides