resolution media query (compatibility prefixes)
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.
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 |
- Implemented as an alias for `-moz-device-pixel-ratio`.
- Implemented as an alias for `max--moz-device-pixel-ratio`.
- Implemented as an alias for `min--moz-device-pixel-ratio`.
Syntax
@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.
Related links
Powered by web-features