concept
Media range syntax — CSS reference
Range syntax permits inequalities and chained comparisons for range-type media features. Here 400 is inclusive and 1000 exclusive; min-width and max-width use inclusive boundaries. Avoid inventing fractional epsilon breakpoints.
Formal Syntax & Structure
css syntaxcss
@media (400px <= width < 1000px) { /* conditional declarations */ }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>media-range-syntax</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}@media (400px <= width < 1000px) {#a{color:rgb(0,100,0)}}</style><body><main id="a">Resize the viewport to explore this example.</main></body></html>