3
@media only screen and (min-width: 480px) and (max-width: 767px) {
}

Here is my media query how to fix it. how to set for safari web browser.

Halvor Holsten Strand
  • 19,829
  • 17
  • 83
  • 99
Pavnish Yadav
  • 2,728
  • 3
  • 15
  • 14

1 Answers1

5

Media queries aren't made for browser detection. Use javascript instead, for example:

if (navigator.userAgent.search("Safari") >= 0 && navigator.userAgent.search("Chrome") < 0) 
{
   alert("Browser is Safari");          
}

From this point you could set a class on the body tag to indicate a safari browser.

if (navigator.userAgent.search("Safari") >= 0 && navigator.userAgent.search("Chrome") < 0) 
{
   document.getElementsByTagName("BODY")[0].className += " safari";
}

Then you can use your CSS to target only safari elements like so:

body.safari h1{
    color: cyan;
}

More discussion on detecting the browser can be found here

Community
  • 1
  • 1
Mihey Egoroff
  • 1,542
  • 14
  • 23