Created
October 23, 2013 14:57
-
-
Save apfelbox/7120371 to your computer and use it in GitHub Desktop.
Retina CSS example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>CSS Sprites + Retina</title> | |
<meta charset="utf-8" /> | |
<style type="text/css"> | |
.with-retina, | |
.without-retina { | |
background-color: transparent; | |
background-repeat: no-repeat; | |
background-position: 0 -150px; | |
width: 117px; | |
height: 36px; | |
} | |
.with-retina { | |
background-image: url("sprite_sheet@2x.png"); | |
background-size: 196px 215px; | |
} | |
.without-retina { | |
background-image: url("sprite_sheet.png"); | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Without Retina</h1> | |
<div class="without-retina"></div> | |
<h2>With Retina</h2> | |
<div class="with-retina"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment