CSS Targeting Browsers Separately
Targeting
2008, http://www.ejeliot.com/blog/63
.myclass{
margin-top:10px; /* all browsers including Mac IE */
margin-top:10px\9; /* IE5.55 to IE8 */ /* http://www.borism.net/2009/03/19/anti-ie8-css-hack/ */
*margin-top:10px; /* IE 7 and below */
_margin-top:10px; /* IE 6 and below */
_mar\gin-top:10px; /* IE 6 only */
}
@media screen and (-webkit-min-device-pixel-ratio:0){ /* modern Safari and Opera */
margin-top:10px;
}
Safari
Targeting Safari (and Opera?), http://www.odindev.com/node/90
@media screen and (-webkit-min-device-pixel-ratio:0){
.myclass{
margin-top:10px;
}
}
Firefox
Filtering, everyone sees except FF. Was used for MAC FF once
div/**/.myclass{
margin-top:10px;
}
Adding something conditionally for IE
In head section. Some internal or external address. The path has to be relative to the file of web page.
<!--[if IE]>
<style type="text/css">
body {behavior: url(http://sample.com/csshover.htc);}
</style>
<![endif]-->
<!--[if IE 6]>Special instructions for IE 6 here<![endif]-->
<!--[if lte IE 7]>Internet Explorer 7 and lower<![endif]-->
2008, 2009.
Web Development - XHTML CSS JavaScript jQuery.