Diagnosis

Invalid doctype

5

If the doctype cannot be properly interpreted by IE, IE will revert to Quirks mode, which will essentially display the site as IE6. The document must have a valid doctype, and it must be the first line in the file.

Background

The doctype lets the browser know what standards your HTML document is following. While most browsers are pretty lenient in this regard, Internet Explorer likes to explode if you haven’t done everything perfectly.

The Problem

If your doctype isn’t properly formatted and detectable, Internet explorer reverts to Quirks Mode, an awful browser rendering similar to IE6. Common causes:

  • Invalid document type – your doctype has to be one of the approved HTML doctypes
  • Missing doctype – your site does not include a doctype
  • Doctype isn’t the first element in the source

If any of the above are true, your site is going to render like it’s 1999 in Internet Explorer.

Identifying the issue

View your source and take a look at the first line. If the doctype declaration is not the first element in the document (before the opening >html< tag), isn’t present, or is malformed, that’s your issue.

The Solution

Make sure that you have a valid doctype and that it is the first line in your HTML.