nesting media queries

Hey, if i'd like something to occur when the viewport width is 640px or above but below 960px, would it be bad practice to nest media queries like this?
@media (min-width: 640px) {
@media (max-width: 960px) {
...
}
}
@media (min-width: 640px) {
@media (max-width: 960px) {
...
}
}
Thanks in advance.
2 Replies
Chris Bolson
Chris Bolson2y ago
You can do that like this
@media (min-width: 640px) and (max-width: 960px) {

}
@media (min-width: 640px) and (max-width: 960px) {

}
snxxwyy
snxxwyyOP2y ago
Ohh I totally forgot about that, thanks a bunch

Did you find this page helpful?