media-feature
Resolution — CSS reference
Resolution tests output pixel density in CSS units. One dppx equals 96dpi. This local context explicitly sets device scale factor to 1; it does not measure physical display quality.
Formal Syntax & Structure
css syntaxcss
@media (resolution: 1dppx) { /* conditional declarations */ }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>resolution</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}@media (resolution: 1dppx) {#a{color:rgb(0,100,0)}}</style><body><main id="a">Resize the viewport to explore this example.</main></body></html>