concept
Media query and — CSS reference
The and operator requires both conditions to match. Parenthesize each feature expression; group mixed logical operators with parentheses instead of relying on implicit precedence.
Formal Syntax & Structure
css syntaxcss
@media (width >= 600px) and (height >= 700px) { /* conditional declarations */ }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>media-query-and</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}@media (width >= 600px) and (height >= 700px) {#a{color:rgb(0,100,0)}}</style><body><main id="a">Resize the viewport to explore this example.</main></body></html>