简体   繁体   中英

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

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.

Just change the second one to

@media screen and (max-width: 964px){

that way the y will be kept seperated and won't interfere with each other.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM