is there a css hack for safari only NOT chrome?

后端 未结 18 1841
旧时难觅i
旧时难觅i 2020-11-22 06:50

im trying to find a css hack for just safari NOT chrome, i know these are both webkit browsers but im having problems with div alignments in chrome and safari, each displays

18条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 06:53

    Step 1: use https://modernizr.com/

    Step 2: use the html class .regions to select only Safari

    a { color: blue; }
    html.regions a { color: green; }
    

    Modernizr will add html classes to the DOM based on what the current browser supports. Safari supports regions http://caniuse.com/#feat=css-regions whereas other browsers do not (yet anyway). This method is also very effective in selecting different versions of IE. May the force be with you.

提交回复
热议问题