Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

device-pixel-ratio css

/* Exact resolution */
@media (-webkit-device-pixel-ratio: 1) {
  p {
    color: red;
  }
}

/* Minimum resolution */
@media (-webkit-min-device-pixel-ratio: 1.1) {
  p {
    font-size: 1.5em;
  }
}

/* Maximum resolution */
@media (-webkit-max-device-pixel-ratio: 3) {
  p {
    background: yellow;
  }
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #css
ADD COMMENT
Topic
Name
4+4 =