0

How to write only safari specific styles without affecting any other browser styles?

I have tried it but it is not working in safari.I'm using Safari 5+.

@media not all and (-webkit-min-device-pixel-ratio:0) {
  .btn-group > .btn + .btn {

      margin-left: -8px;
  }  
  .btn-group:hover a {
      z-index:1;
  }
  .btn-group:hover button{
      z-index:10;
  }
  .input-append input{
      z-index:1;
  }
  .input-append  a{
      z-index:10;
  }

}
fernandopasik
  • 9,565
  • 7
  • 48
  • 55
gaurav
  • 109
  • 2
  • 7
  • 1
    Possible duplicate of http://stackoverflow.com/questions/4053930/apply-css-only-for-safari – Nitesh Aug 30 '13 at 09:40

2 Answers2

0

Try thi site: http://www.browserhacks.com/#sa

html[xmlns*=""]:root .selector {} should work..

so, for the first rule, try following.

html[xmlns*=""]:root .btn-group > .btn + .btn {
  margin-left: -8px;
}  
Madushan
  • 6,977
  • 31
  • 79
-1

Its work perfectly on the Safari browser only

Only for Safari ::i-block-chrome, #your id or class name{ }

preety
  • 309
  • 2
  • 4
  • Could you explain it better? Maybe providing a minimal working example? – norok2 Sep 26 '17 at 12:43
  • Here's an example which would set the font color of your site to red if your browser is Safari
    • abc text
    ::i-block-chrome, .media-list > li{ color: red; }
    – preety Nov 30 '17 at 06:28