[whatwg] DOCTYPE declaration

On Sun, Oct 16, 2011 at 10:30 AM, Francis Boumphrey
<boumphreyfr at gmail.com> wrote:
> I'm not sure if this is the right place to ask this.
> What, if any DOCTYPE declaration should be used on HTML5 documents. As these
> usually refer to a DTD, and living HTML does not have a DTD is it even
> appropriate to use one?

You use the "<!DOCTYPE HTML>" doctype, as explained in the spec.

Doctypes in HTML have never, in practice, actually done anything
useful.  The DTD reference hasn't been followed by any major browser
(the W3C website has had to go to great lengths to protect itself from
being DDOSed by the few editors and niche browsers that *do* follow
DTD references), and essentially acts solely as a talisman that
switches between Quirks Mode and Standards Mode.  "<!DOCTYPE HTML>" is
the minimal string that still triggers Standards Mode in every major
browser.

~TJ

Received on Sunday, 16 October 2011 10:34:53 UTC