resolution media query (compatibility prefixes)
The -webkit-device-pixel-ratio is a non-standard Boolean CSS media feature which is an alternative to the standard resolution media feature.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 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 |
| 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
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.