Skip to content

Instantly share code, notes, and snippets.

@tvandervossen
Created March 2, 2012 12:41
Show Gist options
  • Save tvandervossen/1958155 to your computer and use it in GitHub Desktop.
Save tvandervossen/1958155 to your computer and use it in GitHub Desktop.
How to define a 400 by 200 px sprite image with a 800 by 400 px retina display version
.ui
{
  background-image: url(sprite.png);
}
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
  .ui
  {
    background-image: url(sprite2x.png);
    background-size: 400px 200px;
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment