is there a css hack for safari only NOT chrome?

后端 未结 18 1529
旧时难觅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 07:04

    By the way, for any of you guys that just need to target Safari on mobiles, just add a media query to this hack:

    @media screen and (max-width: 767px) {
        _::-webkit-full-page-media, _:future, :root .safari_only {
            padding: 10px; //or any property you need
        }
    }
    

    And don't forget to add the .safari_only class to the element you want to target, example:

    This div will have a padding:10px in a mobile with Safari

提交回复
热议问题