Browser compatibility debugging

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.