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 Bolson2mo ago
You can do that like this
@media (min-width: 640px) and (max-width: 960px) {

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

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