0

I got a div and it got certain property of css. What I want to do is I want to give the div certain color on safari is this possible?

<div class="disClass">Example div</div>

css

. divClass{
  width: 50px;
  height: 50px;
  background-color:'red'

  //safari only
  // background-color:'blue'
  //
}
Khant
  • 958
  • 5
  • 20
  • 2
    Does this answer your question? [is there a css hack for safari only NOT chrome?](https://stackoverflow.com/questions/16348489/is-there-a-css-hack-for-safari-only-not-chrome) – Cédric Jun 10 '22 at 08:22
  • As shown in the discussion in the link provided by @Cédric any method is likely to be inaccurate in the future as implementations of CSS converge. Already it is impossible to distinguish on IOS as browsers use the same underlying code. You might as well ask the user what they are running. – A Haworth Jun 10 '22 at 08:45

1 Answers1

1

This worked for me.

@media not all and (min-resolution:.001dpcm) { 
  @supports (-webkit-appearance: none) {
   .divClass {
       background: red;
    }
  }
}

hope it helps.

Rayl
  • 188
  • 1
  • 8