Summary
Let's assume that the device's screen width has 667px
. The media queries
will be met. Since the media querie
greater max-width
is after the lower max-width
it is overlapping, this by convention of CSS
what is declared later will override what was declared before.
Solution
Just reverse the%% of position, that is, you first declare the media queries
greater media querie
and then the lower%.
Example:
@media only screen and (max-width: 736px){
.titulo{
color: red;
}
}
@media only screen and (max-width: 667px){
.titulo{
color: blue;
}
}
<h1 class="titulo">
Teste
</h1>
The two max-width
continues to be serviced by the device, but this time the one that prevails is the smaller media queries
because it is later.