0

I am wanting to use a separate CSS sheet on my web-page for Chrome & Safari, than the one used for all other borwser types. I have previously used conditional comments when doing this for IE, such as:

<!--[if !IE]><link rel="stylesheet" type="text/css" href="style.css"><!--<![endif]-->
<!--[if IE]><link rel="stylesheet" type="text/css" href="style2.css"><![endif]-->

but I am wanting the above to work for Chrome & Safari instead. Is this possible?

Sam Friday Welch
  • 265
  • 2
  • 4
  • 14

2 Answers2

0

Conditional comments only work in IE.

This is a creative way to address this problem. I learned it from here

@media screen and (-webkit-min-device-pixel-ratio:0) {  
  /* CSS Statements that only apply on webkit-based browsers (Chrome, Safari, etc.) */
}
Oriol
  • 11,660
  • 5
  • 35
  • 37
0

Mozilla has a vendor specific one as well.

@media screen and (min--moz-device-pixel-ratio:0) {
   /* Firefox browser based CSS goes here */
}
Jeff Clayton
  • 7,053
  • 1
  • 31
  • 36