<resolution>
Widely availableSince 202296% of users
A CSS data type for pixel density, written with dpi, dpcm, dppx or x. You use it in resolution media queries and image-set() to give higher-quality images only to screens that can show the difference.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since September 2022. Widely available since March 2025.
See how modern your own CSS is.Check your CSS →
Quick example
@media (min-resolution: 2dppx) {
/* Styles applied only to high-density/Retina displays */
.icon {
background-image: url('icon-2x.png');
}
}All units
Resolution units
Used in the resolution media query and in image-set() to match or describe pixel density.
| Unit | Measures | Notes | Baseline |
|---|---|---|---|
dpi | Dots per inch | Common in print. 96dpi = 1dppx. | Widely |
dpcm | Dots per centimeter | Metric counterpart to dpi. Rarely used. | Widely |
dppx | Dots per CSS pixel | Most useful on the web. 1dppx is standard density. 2dppx is a typical high-density screen. | Widely |
x | Alias for dppx | Shorthand. 2x is the same as 2dppx. | Widely |
<resolution> browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2022.Safe to use without fallbacks.
Usage96%of people can use this4% use a browser without it.
Browsers
29+
8+
16+
12+Mobile
29+Android
8+Android
16+iOS