1 /***** Selector Hacks ******/
 2 /* IE 6 and below */
 3 * html #uno  { color: red }
 4  
 5 /* IE 7 and below */
 6 *:first-child+html #dos { color: red }
 7  
 8 /* IE 7 and modern browsers */
 9 html>body #tres { color: red }
10  
11 /* Modern browsers (not IE 7) */
12 html>/**/body #cuatro { color: red }
13  
14 /* Opera 9.27 and below */
15 html:first-child #cinco { color: red }
16  
17 /* Safari */
18 html[xmlns*=""] body:last-child #seis { color: red }
19  
20 /*safari 3+, chrome 1+, opera9+, ff 3.5+ */
21 body:nth-of-type(1) #siete { color: red }
22  
23 /* safari 3+, chrome 1+, opera9+, ff 3.5+ */
24 body:first-of-type #ocho {  color: red }
25  
26 /* saf3, chrome1+ */
27 @media screen and (-webkit-min-device-pixel-ratio:0) {
28  #diez  { background: #FFDECE; border: 2px solid #ff0000  }
29 }
30  
31 /***** Attribute Hacks ******/
32  
33 /* ie6 and below */
34 #once { _color:blue }
35  
36 /* ie7 and below */
37 #doce { *color: blue } /* or #color:blue */
38  
39 /* 'Modern Browsers' includes IE8, whether you agree or not.. :) */
40

 

原文出处:http://ajaxian.com/archives/css-browser-hacks

另有一个测试页面在:http://paulirish.com/work/csshacks.html

相关文章:

  • 2022-12-23
  • 2021-09-03
  • 2022-01-31
  • 2022-01-14
  • 2021-09-14
  • 2021-11-19
  • 2022-12-23
  • 2021-12-12
猜你喜欢
  • 2021-09-09
  • 2021-10-22
  • 2021-06-19
  • 2021-09-08
  • 2021-09-27
  • 2022-01-05
相关资源
相似解决方案