We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

The resolution CSS media feature can be used to test the pixel density of the output device.


The resolution feature is specified as a <resolution> value representing the pixel density of the output device. It is a range feature, meaning that you can also use the prefixed min-resolution and max-resolution variants to query minimum and maximum values, respectively.



<p>This is a test of your device's pixel density.</p>


/* Exact resolution */
@media (resolution: 150dpi) {
  p {
    color: red;

/* Minimum resolution */
@media (min-resolution: 72dpi) {
  p {
    font-size: 1.5em;

/* Maximum resolution */
@media (max-resolution: 300dpi) {
  p {
    background: yellow;



Specification Status Comment
Media Queries
The definition of 'resolution' in that specification.
Recommendation Initial definition.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) ? (Yes) No support
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? ? ? No support

Document Tags and Contributors

Contributors to this page: mfluehr, kscarfone, cvrebert
Last updated by: mfluehr,