Skip to content

Instantly share code, notes, and snippets.

@TCotton
Last active December 15, 2015 07:58
Show Gist options
  • Save TCotton/5226925 to your computer and use it in GitHub Desktop.
Save TCotton/5226925 to your computer and use it in GitHub Desktop.
Media query testing on different devices
@media only screen and (max-width:1280px) and (-webkit-min-device-pixel-ratio: 1.0),
only screen and (max-width:1280px) and (min-resolution: 120dpi) {
/* ipad 3 portrait / landscape
ipad 2 portrait / landscape
ipad 1 portrait / landscape
amazon kindle fir hd portrait
nexus 7 landscape
Samsung Galaxy Note 10.1 landscape
Samsung Galaxy Tab 2 10.1 landscape
LG Nexus 4 portrait
Samsung Galaxy Note portrait
Desktop: Chrome and Safari - BELOW 1600 x 1024
*/
body {
background-color: blue!important;
}
}
/* AND below */
@media only screen and (max-width: 767px) {
/* amazon kindle fire 2 portrait
HTC One X portrait
HTC Evo 3D portrait
Motorola Razr Maxx HD portrait
Motorola Razr portrait
Motorola Atrix HD portrait
Motorola Photon 4G portrait
Motorola Droid 4 portrait
Motorola Droid Razr portrait
Samsung Galaxy Nexus portrait
Samsung Galaxy Note II portrait
Samsung Galaxy S III portrait
*/
body {
background-color: yellow!important;
}
}
@media only screen and (max-width: 480px) {
/* iphone 5 portrait / landscape
iphone 4s portrait / landscape
iphome 4 portrait / landscape
iphone 4 portrait / landscape
LG Optimus 3d portrait
Sony Xperia Tipe portrait
Sony Xperia X10 portrait
HTC Wildfire portrait
HTC Hero portrait
Samsung Galaxy S II portrait
Samsung Galaxy S portrait
*/
body {
background-color: black!important;
}
}
@trazek
Copy link

trazek commented Jul 31, 2014

@francoishill Great find. Those links were extremely helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment