-1

I tried this below code but still it is working on both Safari & Chrome.

Please let me know a hack only for Safari not Chrome

.contactDiv img:not(:root:root) { 
    margin-top:-75px;
}  

@media screen and (-webkit-min-device-pixel-ratio:0) {
    .contactDiv img{
         margin-top:-75px;
    }
}

Both are working on Chrome as well as Safari but I want that only on Safari.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Rajendra
  • 31
  • 9
  • 1
    Sounds like a somewhat drastic "hack". Why do you need this? Can't you make the same code work on both? – Matti Virkkunen Apr 28 '16 at 10:52
  • No actually it is differ i can;t understand why it is happen but now i have no solution I have to apply hacks so please if u have any hack which run onllly on safari please let me know – Rajendra Apr 28 '16 at 10:53
  • is there a css hack for safari only NOT chrome? in that link all codes are running on both not only in safari. I want only safari hack – Rajendra Apr 28 '16 at 10:55
  • 2
    You might not need to hack anything. You might just need to change your approach to how you are coding it. Can you create a working example and explain what you are trying to do with the code – Andrew Apr 28 '16 at 10:56
  • It is a custom layout without bootstrap and I am putting up that image with minus margin but px differ on differ browser specially safari – Rajendra Apr 28 '16 at 10:58
  • 3
    "Without bootstrap"? You have to specifically mention that nowadays? Has it really come to this? Good grief... – Matti Virkkunen Apr 28 '16 at 10:58
  • I' ll manage thanks for reply – Rajendra Apr 28 '16 at 11:02
  • are you using any sort of server side language? No – Rajendra Apr 28 '16 at 11:03

2 Answers2

0

Try Following type of rule:

@media screen and (min-width:0\0) {}

Or you can check media hack from Browser Hack also

Gaurav Jariwala
  • 523
  • 2
  • 12
0

This hack is going to work only on Safari:

_::-webkit-full-page-media, _:future, :root .contactDiv img {   margin-top:-75px; }
TylerH
  • 20,799
  • 66
  • 75
  • 101
Juanma Menendez
  • 17,253
  • 7
  • 59
  • 56