Posted By

odenijs on 10/07/10


Tagged

css html browser compliancy


Versions (?)

CSS browser targeting


 / Published in: CSS
 

URL: http://css-tricks.com/snippets/css/browser-specific-hacks/

  1. /* IE 6 */
  2. * html .yourclass { }
  3.  
  4. /* IE 7 */
  5. *+html .yourclass{ }
  6.  
  7. /* IE 7 and modern browsers */
  8. html>body .yourclass { }
  9.  
  10. /* Modern browsers (not IE 7) */
  11. html>/**/body .yourclass { }
  12.  
  13. /* Opera 9.27 and below */
  14. html:first-child .yourclass { }
  15.  
  16. /* Safari */
  17. html[xmlns*=""] body:last-child .yourclass { }
  18.  
  19. /* Safari 3+, Chrome 1+, Opera 9+, Fx 3.5+ */
  20. body:nth-of-type(1) .yourclass { }
  21.  
  22. /* Safari 3+, Chrome 1+, Opera 9+, Fx 3.5+ */
  23. body:first-of-type .yourclass { }
  24.  
  25. /* Safari 3+, Chrome 1+ */
  26. @media screen and (-webkit-min-device-pixel-ratio:0) {
  27. .yourclass { }
  28. }

Report this snippet  

You need to login to post a comment.