files/en-us/web/css/reference/values/resolution/index.md
The <resolution> CSS data type, used for describing resolutions in media queries, denotes the pixel density of an output device, i.e., its resolution.
On screens, the units are related to CSS inches, centimeters, or pixels, not physical values.
The <resolution> data type consists of a strictly positive {{cssxref("<number>")}} followed by one of the units listed below. As with all CSS dimensions, there is no space between the unit literal and the number.
dpi
1dpi ≈ 0.39dpcm.dpcm
1dpcm ≈ 2.54dpi.dppx
px unit. Due to the 1:96 fixed ratio of CSS in to CSS px, 1dppx is equivalent to 96dpi, which corresponds to the default resolution of images displayed in CSS as defined by {{cssxref("image-resolution")}}.x
dppx.[!NOTE] Although the number
0is always the same regardless of unit, the unit may not be omitted. In other words,0is invalid and does not represent0dpi,0dpcm, or0dppx.
@media print and (resolution >= 300dpi) {
/* … */
}
@media (resolution: 120dpcm) {
/* … */
}
@media (resolution >= 2dppx) {
/* … */
}
@media (resolution: 1x) {
/* … */
}
96dpi
50.82dpcm
3dppx
72 dpi Spaces are not allowed between the number and the unit.
ten dpi The number must use digits only.
0 The unit is required.
{{Specifications}}
{{Compat}}