Int I = 0; Int J = 1;
In web development, everyone will encounter CSS compatibility with different browsers. Although it is not a big problem, it is really frustrating, especially for some inexperienced developers, it is a special headache. I often see people complaining about too many browser versions on the Internet, but there is always competition in the market. If there is a problem, we can solve it. The following is my summary of CSS hack for different browsers, hoping to help those who need it.
Background: blue; |
Firefox background turns blue |
Background: red/9; |
The IE8 background turns red |
* Background: black; |
IE7 black |
_ Background: orange; |
The IE6 background changes to orange |
Less than IE6
* HTML {}
Less than IE 7
*: First-Child + HTML {} * HTML {}
Only for IE 7
*: First-Child + HTML {}
Only for IE 7 and modern browsers
HTML> body {}
Only for IE 8 (the attribute value is appended with/0)
. Name {color: # CCC/0 ;}
Only for modern browsers (not IE 7)
HTML>/**/body {}
Latest versions of opera 9 or earlier
HTML: First-child {}
Safari
HTML [xmlns * = ""] body: Last-child {}
Firefox 3
. Classname, X:-moz-any-link, X: Default {}
# ID, X:-moz-any-link, X: Default {}
================================
Background grayed out in all browsers (translucent)
Body {filter: alpha (opacity = 30); opacity: 0.3; Background-color: # CCC ;}
================================
Difference between IE6 and FF:
Background: orange; * Background: blue;
Difference between IE6 and IE7:
Background: Green! Important; Background: blue;
Difference between IE7 and FF:
Background: orange; * Background: green;
Difference ff, IE7, IE6:
Background: orange; * Background: Green! Important; * Background: blue;
Difference ff 3
Add ", X:-moz-any-link, X: Default" before "{", and only FF 3 can recognize it.
Note:
Ie can recognize *; standard browsers (such as ff) cannot recognize *;
IE6 can recognize *, but cannot recognize it! Important,
IE7 can recognize * and can also recognize! Important;
Only IE8 can recognize/0
FF cannot recognize *, but can recognize it! Important;