is there a css hack for safari only NOT chrome?

后端 未结 18 1533
旧时难觅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:14

    Replace your class in (.myClass)

    /* Safari only */ .myClass:not(:root:root) { enter code here }

    0 讨论(0)
  • 2020-11-22 07:15

    hi i ve made this and it worked for me

    @media(max-width: 1920px){
        @media not all and (min-resolution:.001dpcm) {
    
            .photo_row2 {
                margin-left: 5.5% !important;
            }
        }
    }
    
    @media(max-width: 1680px){
        @media not all and (min-resolution:.001dpcm) {
    
            .photo_row2 {
                margin-left: 15% !important;
            }
    
        }
    }
    
    @media(max-width: 1600px){
        @media not all and (min-resolution:.001dpcm) {
    
            .photo_row2 {
                margin-left: 18% !important;
            }
    
        }
    }
    
    
    @media (max-width: 1440px) {
    @media not all and (min-resolution:.001dpcm) {
    
            .photo_row2 {
                margin-left: 24.5% !important;
            }
    
        }
    
    }
    
    
    @media (max-width: 1024px) {
    @media not all and (min-resolution:.001dpcm) {
        @media {
            .photo_row2 {
                margin-left: -11% !important;
            }
    
        }
    
    }
    
    0 讨论(0)
  • 2020-11-22 07:15

    This works:

    @media not all and (min-resolution:.001dpcm) { 
      @media {
        /* your code for Safari Desktop & Mobile */
        body {
          background-color: red;
          color: blue;
        }
        /* end */
      }
    }
    
    0 讨论(0)
  • 2020-11-22 07:16

    Sarari Only

    .yourClass:not(:root:root){ 
        /* ^_^ */ 
    }
    
    0 讨论(0)
  • 2020-11-22 07:16

    For those who want to implement a hack for Safari 7.0 and below, but not 7.1 and above -- use:

    .myclass { (;property: value;); }
    .myclass { [;property: value;]; }
    
    0 讨论(0)
  • 2020-11-22 07:18

    This hack 100% work only for safari 5.1-6.0. I've just tested it with success.

    @media only screen and (-webkit-min-device-pixel-ratio: 1) {
         ::i-block-chrome, .yourcssrule {
            your css property
        }
    }
    
    0 讨论(0)
提交回复
热议问题