Muhamad Muhamad - 20 days ago 6
CSS Question

media screen and min-width: 965px and max-width: 965px

@media screen and (min-width: 965px){
//style here
}
@media screen and (max-width: 965px){
//some other style
}


every thing works fine in less than or more than 965px but when the screen on 965px bugs appear

is there is any way to fix that

Answer

Switch the order and give yourself 1px of leeway between the 2.

@media screen and (max-width: 964px){
   //some style
}   


@media screen and (min-width: 965px){
   //style here
}

This way, there is no overlap.

Note: It is not recommended to use bot min and max width in screen size queries. If you just use min-width, and list them from smallest to largest, the one below will override the one above it.

Comments