-
-
Save dumindu/3359218 to your computer and use it in GitHub Desktop.
How to target mobile devices with CSS Media Queries
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
@media only screen and (-webkit-device-pixel-ratio: .75) { | |
/* CSS for Low-density Android screens goes here * | |
* Ex: HTC Evo, HTC Incredible, Nexus One */ | |
} | |
@media only screen and (-webkit-device-pixel-ratio: 1) and (max-device-width: 768px) { | |
/* CSS for Medium-density Android screens goes here * | |
* Ex: Samsung Ace, Kindle Fire, Macbook Pro * | |
* max-device-width added so you don't target laptops and desktops */ | |
} | |
@media only screen and (-webkit-device-pixel-ratio: 1.5) { | |
/* CSS for High-density Android screens goes here * | |
* Ex: Samsung Galaxy SII, HTC Nexus One, HTC Evo 3D */ | |
} | |
@media only screen and (-webkit-device-pixel-ratio: 2) { | |
/* CSS for Ultra-high-density (Retina) Android screens goes here * | |
* Ex: Samsung Galaxy SIII, HTC Evo LTE, Samsung Galaxy Nexus */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment