1. Conditional Comment Control
! [if! IE] "not" operator
Lt [if Lt IE 6] is less than
LTE [If LTE IE 6] is less than or equal to
GT [If GT IE 6] greater than
GTE [if GTE IE 6] greater than or equal to
() [If (LTE IE 6)] for sub-expressions, with Boolean operators
& [if (LTE IE 9) & (GT IE 6)] and operator
| [If (GT IE6) | (! IE)] or operator
such as:<!--[if IE 6]> only IE6 can be identified <! [endif]-->
* Can only be recognized by IE browser
IE 7 Not only recognizes * symbols, but also identifies!important
div{
Color:green; Show Green in Firefox
Color:red!important; Red shown in//ie7
*color:blue; //IE6 blue in display
}
IE can recognize *html and *+html, non-IE browser does not recognize
div{color:red;} Non-IE display red
*html div{Color:green;} IE6 Show Green
*+html div{Color:blue;} IE7 Show Blue
More ways to differentiate between browsers
#ie6 {_display:block;} IE6
#ie7 {*+display:block;} IE7
#ie8 {display:block\0;} IE8
: Root #ie9 {display:block\0;} IE9 Ten
2. Common attribute prefixes
-webkit WebKit Core Browser Chrome Safari, etc.
-moz Firefox
-ms IE
-O Opera
such as: rotation effect
Div{
margin:30px;
width:200px;
height:100px;
Background-color:yellow;
/* Rotate DIV */
-ms-transform:rotate ( -3DEG); /* Internet Explorer */
-moz-transform:rotate ( -3DEG); /* Firefox */
-webkit-transform:rotate ( -3DEG); /* Safari and Chrome */
-o-transform:rotate ( -3DEG); /* Opera */
Transform:rotate ( -3DEG); /* No attribute prefix, put in the end will overwrite the prefix of the preceding attribute of the definition */
}
3.ie6 Medium Float Moving Element double the vegetarian. Margin Issues
The first element in the IE6 that floats to the edge of the parent element, if there is a margin value in that direction, is doubled.
Workaround: Add attribute display:inline for floating elements;
4.
Partial css (Hack)