Browser compatibility debugging-ie CSS HACK
IE CSS HACK
For different versions of, IE browser, CSS compatibility debugging syntax:
Use as little of the CSS Hack as possible
Use required HTML Document declaration <! DOCTYPE html> otherwise invalid
IE F12, switch browser mode test.
(Note: IE browser F12 switch ie different version only under IE10 support, so the recommended installation ie10,ie11 can uninstall update patch fallback IE10)
If the console is not visible but the taskbar is displayed. Place the mouse on the developer tool on the taskbar, and a transparent area appears. Move the mouse to the developer tools thumbnail, right-maximize, or right-move, and then manually resize the window.
Attribute-level hack (common)
. test{
Background: #f00; /* All browsers */
*background: #0f0; /*ie6,ie7*/
_background: #f00; /*ie6*/
}
Condition hack
IE Conditional Comment statement (recommended for complex debugging)
Statement is HTML code, non-CSS code
Applicable version: Ie6-9, other IE versions do not support this debug statement
<!--[if IE 6]>
<link rel= "stylesheet" href= "Ie6.css" >
<style>div{color: #f00;} </style>
<script src= "Ie6.js" ></script>
<! [endif]-->
All conditions: The IF condition contains 6 kinds of choices: Yes, non, greater than, greater than, less than, less than or equal to
If it is IE
<!--[If ie]><! [endif]-->
If it's IE7,
<!--[if IE 7]><! [endif]-->
If greater than IE7
<!--[if GT IE 7]><! [endif]-->
If greater than or equal to IE7
<!--[if GTE IE 7]><! [endif]-->
If less than IE7
<!--[If Lt IE 7]><! [endif]-->
If less than or equal to IE7
<!--[If LTE IE 7]><! [endif]-->
If not IE7
<!--[if! IE 7]><! [endif]-->
Browser compatibility debugging