Force Quirks mode with Doctype
doctype, html
Solution
See http://hsivonen.iki.fi/doctype/ for changing the `DOCTYPE` to Almost Standards mode or Quirks mode. Excerpts below. (Assumes a `Content-Type` of `text/html`.)
Almost Standards mode:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
This gives you the Almost Standards mode. Please note that your layouts based on sliced images in tables are likely to break if you later move to HTML5 (and, hence, the full Standards mode), so it’s better to make your designs Standards mode-compatible right now.
Quirks mode:
No doctype.
Please don’t do this. Willfully designing for the Quirks mode will come and haunt you, your coworkers or your successors in the future.
XHTML doctype:
I am not recommending any of the XHTML doctypes, because serving XHTML as `text/html` is considered harmful. If you choose to use an XHTML doctype anyway, please note that the XML declaration makes IE 6 (but not IE 7!) trigger the Quirks mode.
Problem
I have a page which needs to be rendered in Quirks mode for the page to be loaded properly. The problem is that the page uses valid XHTML and thus has a doctype. This forces the page to render in Standards mode in all browsers. Is there any workaround/hack that can force Quirks mode eventhough I have a doctype?