Target safari css, but not chrome

41,888

Found somewhere else here. worked fine for me

@media screen and (-webkit-min-device-pixel-ratio:0) { 
/* Safari and Chrome */
.myClass {
 color:red;
}

/* Safari only override */
::i-block-chrome,.myClass {
 color:blue;
}
}
Share:
41,888
user3353748
Author by

user3353748

Updated on July 09, 2022

Comments

  • user3353748
    user3353748 almost 2 years

    Ran into a problem, where chrome and safari display margin differently. But both of them are webkit, so can't really use a prefix. Is there any solution, or hack that could help with it?

  • sohaiby
    sohaiby over 8 years
    Microsoft Edge also support some features of -webkit ... your answer will target MS Edge as well
  • cptstarling
    cptstarling about 8 years
    Not working for me, but this does: stackoverflow.com/questions/16348489/…