When you write CSS, the style sheet plus the browser identifier is OK, the browser differences are as follows:
IE can recognize *, the standard browser (such as FF) is not recognized *;
IE6 can identify the *, but does not recognize!important;
IE7 can recognize *, can also identify!important;
IE8 can recognize the *,+,_,* and not recognize the!important;
FF does not recognize *, but can identify!important;
For example style= "*width:10px!important; width:20px; "
This way, the width is 10px under IE6, and the width of IE7 is 20px
There are also three ways of writing:
1 Kinds:
width:100px; /* Firefox and other browsers */
width:200px\0; /* IE8 can identify \0*/
*width:300px!important; /*, IE7 can recognize both * and important */
*width:400px; /* IE6 can also identify * * *
/* Note ORDER */
2 Kinds:
width:100px; /* Firefox and other browsers */
width:200px\0; /* IE8 can identify \0*/
*width:300px; /* IE7 can also identify * * *
_width:400px; /* IE6 can recognize the underline */
/* Note ORDER */
3 Kinds:
width:100px; /* Firefox and other browsers */
width:200px\0; /* IE8 can identify \0*/
+width:300px; /* + only recognize IE7 */
_width:400px; /* IE6 can recognize the underline */
/* Note ORDER */
1..color1{color: #F00; color/*\**/: #00F/*\**/}/*ie6,ie7,ie8,ff,op,sa Recognition */
2..color2{color: #F00; color/*\**/: #00F/*\9**/}/*ie7,ie8,ff,op,sa Recognition */
3..color3{color: #F00; color/*\**/: #00F \9}/*ie6,ie7,ie8 Recognition */
4..color4{color: #F00; color/*\**/: #00F \9}/*ie7,ie8 Identify a space between *//* "color" and "/*\**/" */
Where: Op means Opera,sa represents safari
————————————-
Hack supported independently by various browsers:
width:100px\0;/* Support IE8 */
_width:100px; /* Support IE6 */
[width:100px;/* Support ie6,7 */
+width:100px; /* Support ie6,7 */
*width:100px; /* Support ie6,7 */
*width:100px!important; /* Support ie6,7, */
*+width:100px; /* Support ie6,7, */
*+width:100px!important;/* supports ie6,7, */
width:100px\9; /* Support ie6,7,8 */
Width:100px!important; /* Support IE6,7,8,FF */
w\idth:100px; /*ie5.x does not support IE6, IE7, IE8, FF support */
------------------
IE Conditional comment function:
<!--[if ie]> this content is only IE visible <! [endif]–>
<!–[if IE 6.0]> This content is only IE6.0 visible <! [endif]–>
<!–[if IE 7.0]> This content is only IE7.0 visible <! [endif]–>
Various browser CSS hack