Media Queries firing at wrong width

前端 未结 8 958
抹茶落季
抹茶落季 2020-12-07 18:08

I am building a responsive page and the media queries are firing at the wrong width size. I am using Chrome.

@media screen and (max-width: 1200px) {
 .logo-p         


        
8条回答
  •  萌比男神i
    2020-12-07 19:05

    Another addition. After an hour of debugging I realized I had coded multiple media queries and because css files are executed from top to bottom, I was overriding previous media query logic. Ex:

    @media (max-width: 700px) {
     .some-class { background-color: red; }
    };
    
    // This will override the above styling (assuming max-width logic is true)
    @media (max-width: 800px) {
     .some-class { background-color: yellow; }
    };
    

提交回复
热议问题