CSS Media Query Reference

Search CSS media features, types, and operators with Level 4 range syntax.

Interactive reference for CSS media queries: every media feature descriptor, media type, and logical operator, including the new Media Queries Level 4 range and boolean syntax. Filter by name to find the feature you need.

What is the Level 4 range syntax?

Media Queries Level 4 lets you write range comparisons directly, such as (width >= 600px) or (400px <= width <= 900px), instead of pairing min-width and max-width. Modern browsers support it widely.

CSS media query reference

Media queries apply CSS conditionally based on the device, viewport, or user preferences. A query combines an optional media type (such as screen or print), one or more media features (such as min-width or prefers-reduced-motion), and logical operators (and, ,, not, only). This reference lists every standard feature and operator — including the newer Level 4 range and boolean forms — with values and notes, plus instant search.

How it works

A media query evaluates to true or false; when true, the enclosed rules apply. Range features (width, height, aspect-ratio, resolution) can be written with min-/max- prefixes or, in Level 4, with comparison operators directly inside the parentheses. Discrete features (orientation, prefers-color-scheme, hover, pointer) take a fixed set of keywords. Logical operators chain features: and requires all, a comma means or, not negates, and only shields legacy browsers. The filter matches feature names, values, and descriptions.

Tips and example

Level 4 range syntax is cleaner than paired min/max:

/* old */
@media (min-width: 600px) and (max-width: 900px) { ... }

/* level 4 */
@media (600px <= width <= 900px) { ... }

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; }
}
  • Prefer prefers-reduced-motion: reduce to pare back animations for users who request it — an accessibility win.
  • pointer: coarse and hover: none detect touch devices more reliably than guessing from width alone.
  • Combine a media type and features with and; separate alternative whole queries with commas.