/ Published in: CSS
URL: http://www.nealgrosskopf.com/tech/thread.asp?pid=20
Learn how to target Firefox, Opera, Safari & Internet Explorer with these surefire CSS Hacks.
Expand |
Embed | Plain Text
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>CSS Browser Hacks</title> <style type="text/css"> body p { display: none; } /* Opera */ html:first-child #opera { display: block; } /* IE 7 */ html > body #ie7 { *display: block; } /* IE 6 */ body #ie6 { _display: block; } /* Firefox 1 - 2 */ body:empty #firefox12 { display: block; } /* Firefox */ @-moz-document url-prefix() { #firefox { display: block; } } /* Safari */ @media screen and (-webkit-min-device-pixel-ratio:0) { #safari { display: block; } } /* Opera */ @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { head~body #opera { display: block; } } </style> </head> <body> <p id="opera">Opera 7.2 - 9.5</p> <p id="safari">Safari</p> <p id="firefox">Firefox</p> <p id="firefox12">Firefox 1 - 2 </p> <p id="ie7">IE 7</p> <p id="ie6">IE 6</p> </body> </html>
You need to login to post a comment.
