Hello I have this script and I need when screen size is 1600 px background-color
was red and when screen size is 1366 px background-color
was black, but my code not work, media query works only 1600 px
html
<div>
</div>
css
div{
width:100%;
height:100%;
background-color:grey;
}
@media screen and (max-width:1366px){
div{
background-color:black;
}
}
@media screen and (max-width:1600px){
div{
background-color:red;
}
}
The second styles overwrite the first one. Change the order. It will work.
div{
width:100%;
height:100%;
background-color:grey;
}
@media screen and (max-width:1600px){
div
{
background-color:red;
}
}
@media screen and (max-width:1366px){
div
{
background-color:black;
}
}
DEMO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With