Created
December 26, 2012 17:08
-
-
Save ranbena/4381543 to your computer and use it in GitHub Desktop.
High density display
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
<html> | |
<head> | |
... | |
<link rel='stylesheet' href='retina.css' media='only screen and (min-device-pixel-ratio: 2)' /> | |
... | |
</head> | |
<body> |
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
if (window.devicePixelRatio === 2) { | |
// do something | |
} |
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
.logo { | |
background-image: url('logo.png'); | |
} | |
@media only screen and (min-device-pixel-ratio: 2) { | |
.logo { | |
background-image: url('logo@2x.png'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment