Widely availableUse only when older compatibility branches still matter. Prefer standard resolution syntax for current code.

Overview

Compatibility-prefixed resolution queries bridge older device-pixel-ratio style checks with the standard resolution media query. They are mainly useful in legacy support scenarios.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
63
3
18
1
CSS at-rule

The -webkit-device-pixel-ratio is a non-standard Boolean CSS media feature which is an alternative to the standard resolution media feature.

1
12
63
3
18
1

The -webkit-device-pixel-ratio is a non-standard Boolean CSS media feature which is an alternative to the standard resolution media feature.

1
12
63
3
18
1
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 1 item(s)
Implementation note
  • Implemented as an alias for `-moz-device-pixel-ratio`.
Notes 1 item(s)
Implementation note
  • Implemented as an alias for `max--moz-device-pixel-ratio`.
Notes 1 item(s)
Implementation note
  • Implemented as an alias for `min--moz-device-pixel-ratio`.

Syntax

CSS
@media (-webkit-min-device-pixel-ratio: 2) {
  .logo {
    background-image: url('logo@2x.png');
  }
}

Live demo

Webkit prefix

CSS Webkit prefix demo.

PreviewFullscreen

standardconfigtext

CSS standardconfigtext demo.

PreviewFullscreen

fo-back with

CSS fo-back with demo.

PreviewFullscreen

Use cases

  • Legacy retina support

    Keep older high-density targeting rules alive while migrating to standard queries.

  • Compatibility cleanup

    Document and isolate older prefixed rules until support requirements let you remove them.

Cautions

  • Prefixed compatibility code should be temporary and intentionally bounded.
  • Too many duplicate media-query branches make maintenance harder than the benefit they provide.

Accessibility

  • Compatibility work should still preserve readable assets and robust zoom behavior.
  • Do not let prefixed branches drift into inaccessible or untested variants.

Powered by web-features