Testing

CSS Media Range Syntax: Browser Support, Operators

CSS media range syntax works in Chrome 104+, Edge 104+, Firefox 63+, Safari 16.4+, Opera 91+, and Samsung Internet 20+. See operators, examples, and limits.

Author

Prince Dewani

May 6, 2026

CSS media range syntax is a Media Queries Level 4 feature that uses comparison operators like <, <=, >, and >= to test width, height, and other range-type values. It works in Chrome 104+, Edge 104+, Firefox 63+, Safari 16.4+, Opera 91+, and Samsung Internet 20+, while Internet Explorer never added support.

This guide covers what the syntax is, the browsers that support it, the comparison operators, how to write a range query, the supported features, and known limitations.

What is CSS Media Range Syntax?

CSS media range syntax is the range context defined in the W3C Media Queries Level 4 specification. It lets a CSS @media rule use the comparison operators <, <=, >, >=, and = on range-type features such as width, height, aspect-ratio, and resolution, replacing the older min- and max- prefix forms.

Which browsers does CSS media range syntax support?

CSS media range syntax works in every modern Chromium, Gecko, and WebKit release, with Internet Explorer as the only major engine that never shipped it. Global support sits above 93% of tracked browser usage.

Loading browser compatibility data...

CSS media range syntax compatibility in Chrome

Chrome supports CSS media range syntax from Chrome 104 on Windows, macOS, Linux, ChromeOS, and Android. Chrome 1 to 103 did not support the new operators and skip rule blocks that use them.

CSS media range syntax compatibility in Edge

Edge supports CSS media range syntax from Edge 104 on Windows, macOS, and Linux. Edge picks up the feature from the same Chromium 104 milestone as Chrome, and earlier Edge builds, including the legacy non-Chromium versions, do not support range syntax.

CSS media range syntax compatibility in Firefox

Firefox supports CSS media range syntax from Firefox 63 on Windows, macOS, Linux, and Android. Firefox was the first major browser to ship the syntax, well ahead of Chromium and Safari, and Firefox 1 to 62 do not support it.

CSS media range syntax compatibility in Safari

Safari supports CSS media range syntax from Safari 16.4 on macOS and from Safari on iOS 16.4 on iPhone and iPad. Safari 1 to 16.3 on macOS, and Safari on iOS 3.2 to 16.3, ignore the new operators and skip the rule block.

CSS media range syntax compatibility in Opera

Opera supports CSS media range syntax from Opera 91 on Windows, macOS, and Linux, with Opera Mobile picking it up from version 80 on Android. Opera 1 to 90 and Opera Mobile 12.1 and earlier do not support it.

CSS media range syntax compatibility in Samsung Internet

Samsung Internet supports CSS media range syntax from Samsung Internet 20 on Android phones and tablets. Samsung Internet 4 to 19 ship the older min- and max- syntax only.

CSS media range syntax compatibility in Android Browser

Android Browser supports CSS media range syntax from Android Browser 147 on. Older Android Browser builds, including the 4.4.4 stock browser, do not parse the new operators and need min-width and max-width fallbacks.

CSS media range syntax compatibility in Internet Explorer

Internet Explorer never supported CSS media range syntax. IE 5.5 through IE 11 only understand the older min- and max- prefix style, and Microsoft has retired Internet Explorer, so move IE-bound work to Chromium-based Edge.

Note

Note: CSS media range syntax breaks across older Safari, IE, and stale Android Browser builds. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!

What are the comparison operators in CSS media range syntax?

Range syntax exposes five comparison operators that map to the math symbols a developer already knows. Each operator works on any range-type media feature.

  • Less than (<): matches when the feature value is strictly below the comparison value, for example (width < 600px) matches viewports up to 599 pixels wide.
  • Less than or equal (<=): matches when the feature value is at or below the comparison value, equivalent to the older max- prefix form.
  • Greater than (>): matches when the feature value is strictly above the comparison value, for example (width > 1024px) matches 1025 pixels and up.
  • Greater than or equal (>=): matches when the feature value is at or above the comparison value, equivalent to the older min- prefix form.
  • Equal (=): matches when the feature value matches the comparison value exactly, useful for resolution and aspect-ratio checks.
  • Bounded range: wrap a feature with two operators, like (400px <= width <= 1000px), to test a min and max bound in one expression instead of chaining with and.

How do you write a CSS media range query?

Drop the new operators inside the parentheses of an @media rule. The rule body is identical to a classic media query, only the feature expression changes.

  • Open an @media block: Start with @media followed by an optional media type, such as screen, then an opening parenthesis.
  • Pick a range-type feature: Type a feature name like width, height, aspect-ratio, or resolution. Discrete features such as hover and orientation do not accept the new operators.
  • Add a comparison operator: Choose <, <=, >, >=, or = and follow it with the value, for example (width >= 600px).
  • Bracket a range when needed: For a min and max bound, wrap the feature with two operators, like (400px <= width <= 1000px), instead of chaining min-width and max-width with and.
  • Confirm in DevTools: Open Chrome 104, Firefox 63, or Safari 16.4 DevTools, resize the viewport, and watch the matched rules in the Styles panel light up at the boundary value.

A common pattern looks like the snippet below, which combines a single-bound rule and a bounded-range rule on the same selector.

/* Single-bound rule: matches viewports 600px wide and up. */
@media (width >= 600px) {
  .card {
    padding: 24px;
  }
}

/* Bounded-range rule: matches 400px through 1000px inclusive. */
@media (400px <= width <= 1000px) {
  .card {
    border-radius: 12px;
  }
}

If a browser does not understand the new operators, the entire @media block is skipped, so always pair production-critical layout rules with a min-width or max-width fallback for older Safari and Android Browser builds.

...

Which media features support range syntax?

Range syntax only applies to features the spec marks as range type. Discrete features keep the equals-and-keyword form.

  • Width and height: the most common pair, used for viewport breakpoints with (width >= 768px) and similar checks.
  • aspect-ratio: match a viewport ratio with (aspect-ratio >= 16/9) for letterboxed layouts and split panes.
  • resolution: serve high-density assets with (resolution >= 2dppx) for Retina, HiDPI, and 4K displays.
  • color, color-index, monochrome: test color depth and palette size for grayscale e-readers and limited-color devices.
  • device-width and device-height: the original device-screen features keep working with the new operators, although width and height are preferred for responsive layouts.
  • Discrete features stay literal: orientation, hover, pointer, prefers-color-scheme, prefers-reduced-motion, and display-mode reject <, <=, >, and >=, since their values are keywords, not numbers.
...

What are the limitations of CSS media range syntax?

Range syntax is a clean win for modern browsers, but a small set of cross-engine quirks still bite real projects. The common pain points cover the Safari pre-16.4 gap, IE 11 fallbacks, sanitizer behavior, and Sass mixed-mode parsing.

  • Safari shipped late: Safari 16.3 and earlier on macOS and iOS skip range syntax entirely, so a (width > 600px) rule has no effect on iPhones still on iOS 16.3. Pair critical layout rules with a min-width fallback or run a PostCSS transform.
  • IE 11 has no fallback path: Internet Explorer never parsed the new operators. Projects that still serve IE 11 must keep min-width and max-width rules, since rule blocks that use range syntax are dropped on IE.
  • Mixed Sass and CSS parsers can choke: Older Sass and PostCSS plugin chains parse <= and >= as boolean operators in interpolation contexts. Upgrade to Dart Sass 1.55+ and PostCSS 8.4+, or wrap the values in # interpolation.
  • Discrete features still need keywords: orientation, hover, pointer, and prefers-color-scheme reject the new operators. Mixing range and discrete features in one query needs and chains, just like the legacy syntax.
  • No partial fallback: when a browser fails to parse a range expression, the entire @media rule body is skipped, not the single rule. A typo in one feature kills every selector inside that block.
  • Equal (=) is rarely useful: exact-match equality on width or height almost never matches a real viewport, so the = operator mostly applies to resolution and aspect-ratio rather than width.

In my experience, the trickiest production failure is the Safari 16.3 gap. A rule using (width >= 768px) renders perfectly in Chrome and Firefox, then silently drops on a tester's iPhone running iOS 16.2, and the bug looks like a CSS specificity issue. Always test the new syntax on real Safari builds before shipping.

Citations

All CSS media range syntax version numbers and platform notes in this guide come from these primary sources:

Author

Prince Dewani is a Community Contributor at TestMu AI, where he manages content strategies around software testing, QA, and test automation. He is certified in Selenium, Cypress, Playwright, Appium, Automation Testing, and KaneAI. Prince has also presented academic research at the international conference PBCON-01. He further specializes in on-page SEO, bridging marketing with core testing technologies. On LinkedIn, he is followed by 4,300+ QA engineers, developers, DevOps experts, tech leaders, and AI-focused practitioners in the global testing community.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Frequently asked questions

Did you find this page helpful?

More Related Hubs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests