Doctype
Doctype Full name: Document Type Declaration (document type declaration, abbreviated to DTD)
The declaration of DTD affects the browser's parsing of CSS code and JavaScript scripts.
Rendering Mode
Rendering modes include mixed mode, near standard mode, and standard mode
Except for IE6/7, the standard mode is not supported. all browsers in other modes support this mode;
Relationship between docytpe and rendering Mode
1. hybrid mode: Do not write the doctype Declaration;
2. Close to standard mode: HTML declaration of Transition type (Transitional) or framework type (frameset) and XHTML declaration of Transition type or framework type;
3. Standard mode: HTML5 doctype declaration and strict HTML declaration and strict XHTML Declaration;
Other scenarios where hybrid mode is activated:
The following content appears before the doctype Declaration: plain text, HTML Tag, HTML annotation, XML declaration, and IE condition annotation.
Use js to determine the current browser mode:
Document. compatmode = 'css1compat '? 'Standard mode': 'Mixed mode ';
IE, Firefox, opera, sarari, and chrome all implement this attribute;
Special situations of IE8:
IE8 introduces a new attribute named documentmode for the document object, because IE8 has three different rendering modes. If the value of this attribute is 5, it indicates the hybrid mode (ie 5 mode); if it is 7, it indicates the IE7 simulation mode; if it is 8, it indicates the IE8 standard mode.
Support in IE8 +
Reference: http://hi.baidu.com/flondon/item/4da1a01c3885967f7b5f2598