긴자손-1 2010. 2. 18. 15:15
반응형

핵을 사용하는것이 좋은 방법은 아닙니다만
다른 개발자가 작성한 코드를 이해하거나 하는 등의 경우에 대비해야 하지 않을까 생각합니다.

다음은 바울 아이리시Poul Irish 가 작성한 내용(IE Comment Hack을 사용하여 바디요소에 버전별 클래스를 부여하는 방법)과 Ajaxian.com의 댓글내용입니다.

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

미네르바의 부엉이는 황혼과 함께 나래를 편다

반응형