Why media queries work like this?

0

I was creating a responsive menu, and u noticed that if I did not put the media queries from the smallest to the largest it does not work correctly.

@media only screen and (min-width:560px) {
    .menu li {
        width: 132px;
        height: 50px;
    }

    .menu li a {
        width: 132px;
        height: 50px;
        color: red;
        position: absolute;
        font: bold 18px Arial, Tahoma, Helvetica;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
        -webkit-justify-content: center;
        justify-content: center;
    }
}

@media only screen and (min-width:960px) {
    .menu li {
        width: 132px;
        height: 50px;
    }

    .menu li a {
        width: 132px;
        height: 50px;
        color: #fff;
        position: absolute;
        font: bold 18px Arial, Tahoma, Helvetica;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
        -webkit-justify-content: center;
        justify-content: center;
    }
}
    
asked by anonymous 26.07.2017 / 17:23

1 answer

3

Because "Media Queries use" growing ", that is, by first applying styles to devices with lower resolutions." link Perhaps the reason is the ease of organization

    
26.07.2017 / 20:50