Safari ignoring css max-width media queries below a certain point

前端 未结 3 675
暖寄归人
暖寄归人 2020-12-17 14:52

I\'m working on optimizing a responsive site and Safari (both desktop and mobile) seems to be completely ignoring media queries below a certain point. I have code like the

3条回答
  •  伪装坚强ぢ
    2020-12-17 15:39

    Turns out I was missing a squiggly brace, so I had code like the following:

    @media screen and (max-width: 767px){
        /* lots of css */
        .some_selector { padding: 20px; /*<---- missing squiggly brace*/
        /* more css */
    }
    @media screen and (max-width: 640px){
        /* lots more css */
    }
    

    Inserting the missing brace caused Safari to begin working. Other browsers didn't choke on the error which is partially why it was so difficult to track down.

    Thanks for the help everyone, I feel pretty silly now.

提交回复
热议问题