(1)CSS hack (-,*,! Important)
|
IE6 |
IE7 |
FF |
* |
√ |
√ |
× |
- |
√ |
× |
× |
! Important |
× |
√ |
√ |
Note: √ supported × not supported
From the table above, different CSS files can be written based on different browsers.CodeCalledCsshack
Differences FF , IE7 , Hack writing in IE6 : Background: Orange ; * Background: Green ! Important ; * Background: Blue ; Note: Background: Orange ; This sentence can be set for all browsers, and can be set for IE7. * Background: Green ! Important overwrites the previous style. , * Background: Blue IE6 and 7 can also be set, but IE7 has already been set! Important kills everything in seconds Note: No matter what method, the writing sequence is Firefox, IE7, and IE6. (Reference)
(2)Conditional Style Sheets
For more information, see (http://www.cnblogs.com/chongzi/archive/2010/11/24/1886423.html ),
Hack is used <! -- [If lte ie 6]> CSS import <! [Endif]> This statement can be set only for IE.
Same as above<! -- [If lte ie 7]> <! -- [If lte ie 8]> IE7 IE8 settings
Reference document: http://blog.csdn.net/arcow/archive/2007/07/06/1681027.aspx