Skip to content

Instantly share code, notes, and snippets.

@samzeng
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samzeng/bf0800d3e5ed2ff3f397 to your computer and use it in GitHub Desktop.
Save samzeng/bf0800d3e5ed2ff3f397 to your computer and use it in GitHub Desktop.
/* Use media queries for high-res CSS styles */
.demo {
background-image: url(test.png);
}
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
background-image: url(test-@2x.png);
}
/* image-set W3C: http://dev.w3.org/csswg/css-images/#image-set-notation */
.demo {
background: url(test.png); /* do not support `image-set` */
background: -webkit-image-set(
url(test.png) 1x, /* normal displays */
url(test-@2x.png) 2x /* high-res retina displays */
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment