Created
November 20, 2013 19:57
-
-
Save bavington/7569953 to your computer and use it in GitHub Desktop.
Retina Detection Media Query for working with Retina Background Images.
This file contains hidden or 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
div.logo { | |
margin:0 auto; | |
border:1px solid #666; | |
width:400px; | |
height:215px; | |
background:url(james-n-nick.jpg) no-repeat; | |
} | |
@media only screen and (-webkit-min-device-pixel-ratio: 2), | |
only screen and (-webkit-min-device-pixel-ratio: 1.5), | |
only screen and (-moz-min-device-pixel-ratio: 2), | |
only screen and (-o-min-device-pixel-ratio: 3/2), | |
only screen and (-o-min-device-pixel-ratio: 2/1), | |
only screen and (min--moz-device-pixel-ratio: 1.5), | |
only screen and (min-device-pixel-ratio: 1.5), | |
only screen and (min-device-pixel-ratio: 2) { | |
/* Add your Retina Image Replacement Classes here. */ | |
div.logo { | |
background:url([email protected]) no-repeat; | |
background-size: 400px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment