Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a css line ONLY for Safari

I am making a website, but an element needs margin in Chrome and other browsers, but not in safari. So I want to add a css line to fix it, but I can't find any method to add css for safari 3+ only.

like image 857
Johan Avatar asked Jul 14 '13 08:07

Johan


People also ask

How do I get CSS to work in Safari?

Displaying properties in Safari There is a CSS appearance property used to display an element using a platform-native styling based on the users' operating system's theme. To make it work on Safari, we must set the appearance property to its "none" value. Also, use -WebKit- and -Moz- vendor prefixes.

How do I display a specific HTML browser?

Open the Google Chrome page Open the Google Chrome page of the specific HTML that you want to inspect. Press "Control" + "U" on the keyboard and a separate page with the source code appears.


1 Answers

This worked for me for old and new safari browsers:

@media not all and (min-resolution:.001dpcm) { 
  @supports (-webkit-appearance: none) {
    /* Safari Only CSS here */
  }
}
like image 179
Tony Tai Nguyen Avatar answered Sep 19 '22 22:09

Tony Tai Nguyen