Posts Tagged css

[转载]可同时区分IE8、IE7、IE6、Firefox3、Firefox2的CSS hacks

phpchina上看到的,转过来,做个备忘。
可同时区分IE8、IE7、IE6、Firefox3、Firefox2的CSS hacks:

  1. color:/*\**/#00f\9; /* IE8 */
  2. }
  3. .test,
  4. .test:-moz-any-link{
  5.     color:#f60; /* Firefox2 */
  6. }
  7. .test,
  8. .test:default{
  9.     color:#000; /* Firefox3 */
  10.     *color:#f00; /* IE7 */
  11.     _color:#0f0; /* IE6 */
  12. }

可同时区分IE8、IE7、IE6、Firefox的CSS hacks:

  1. .test{
  2.     color:#000; /* Firefox */
  3.     color:/*\**/#00f\9; /* IE8 */
  4.     *color:#f00; /* IE7 */
  5.     _color:#0f0; /* IE6 */
  6. }

关于IE8的hacks:

  1. .test{
  2.     color:/*\**/#00f\9; /* IE8 only */
  3.     color:#00f\9; /* 适用于所有IE版本 */
  4. }

No Comments