开发者

Force Quirks mode with Doctype

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 开发者_StackOverflowany workaround/hack that can force Quirks mode eventhough I have a doctype?


I also have a page that must live in the 90s along with all the memory leaks that come with IE in quirks mode, this is the DOCTYPE we use.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >


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.


Try removing the doctype?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜