The following example will display the #box color background in Chrome and Safari, but not Firefox and Opera.
<!DOCTYPE html> <html> <head> <style type="text/css"> @media screen and (-webkit-min-device-pixel-ratio:0) { #box { background: #f0f; } } </style> </head> <body> <div id="box"> I'll have a background in Webkit browsers. </div> </body> </html>
If thatβs not enough, you can take a look at this article about browser-specific CSS hacks on Webmonkey . It includes works for both Internet Explorer, Firefox, Safari, and Opera, as well as for the example above.
source share