is there a css hack for safari only NOT chrome?

2018-12-31 14:02发布

im trying to find a css hack for just safari NOT chrome, i know these are both webkit browsers but im having problems with div alignments in chrome and safari, each displays differently.

i have been trying to use this but it affects chrome as well,

@media screen and (-webkit-min-device-pixel-ratio:0) { 
  #safari { display: block; } 
} 

does anyone know of another one that will just apply to safari please?

标签: css safari
13条回答
时光乱了年华
2楼-- · 2018-12-31 15:02

There is a way to filter Safari 5+ from Chrome:

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

    /* Safari only override */
    ::i-block-chrome,.myClass {
     color:blue;
    }
}
查看更多
登录 后发表回答