Jump to content

saila.com

Online media matters

Should I use a DOCTYPE declaration?

Newer browsers are relying on the DOCTYPE declaration (a.k.a, DTD) to determine how a page should be displayed.

Pages with a valid HTML 4.01 or XHTML 1 DOCTYPE will be displayed by those browser according to the official specifications. Pages without a DOCTYPE or specifying an older one will render pages in what has been called “quirks mode.”

Developing standard-compliant page with a DOCTYPE makes it easier to debug and, ideally, create ones that display almost exactly the same across various browsers and platforms. For more information read:

With a valid page, various workarounds (like browser detection) can be used to make the pages work in older browsers. If, however, your pages rely on non-standard kluges, you should probably not declare a DOCTYPE (but you really should be writing pages that validate).