Force Quirks Mode with Doctype

I have a page that needs to be displayed in Quirks mode for the page to load correctly. The problem is that the page uses valid XHTML and therefore has doctype. This makes the page display in standard mode in all browsers. Is there a workaround / hack that can force Quirks mode even if I have doctype?

+4
source share
3 answers

See http://hsivonen.iki.fi/doctype/ for changing the DOCTYPE mode to DOCTYPE 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 layouts based on sliced ​​images in tables may break if you then switch to HTML5 (and therefore the full standards mode), so it’s better to make your projects compatible with the standards right now.

Quirks Mode:

No doctype.

Please, do not do that. The deliberate design for Quirks mode will come and haunt you, your colleagues, or your successors in the future.

XHTML doctype:

I do not recommend any XHTML doctrines because it serves XHTML since text/html is considered harmful . If you decide to use XHTML doctype anyway, note that the XML declaration makes IE 6 (but not IE 7!) Run Quirks mode.

+4
source

I also have a page that should 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" > 
+6
source

Try to remove doctype?

+3
source

Source: https://habr.com/ru/post/1303515/


All Articles