Skip to content

Instantly share code, notes, and snippets.

@nhall
Created May 19, 2013 04:50
Show Gist options
  • Save nhall/5606726 to your computer and use it in GitHub Desktop.
Save nhall/5606726 to your computer and use it in GitHub Desktop.
CSS for swapping hi-res background images.
/*
-----------------------------------------------------------------------------
=High Resolution Images
----------------------------------------------------------------------------- */
@media screen and (-webkit-min-device-pixel-ratio: 1.3),
screen and (min--moz-device-pixel-ratio: 1.3),
screen and (-o-min-device-pixel-ratio: 2 / 1),
screen and (min-device-pixel-ratio: 1.3),
screen and (min-resolution: 192dpi),
screen and (min-resolution: 2dppx) {
#site-name a {
background-image: url(/images/common/bg-logo-2x.png);
-webkit-background-size: 303px 25px;
-moz-background-size: 303px 25px;
-o-background-size: 303px 25px;
background-size: 303px 25px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment