Skip to content

Instantly share code, notes, and snippets.

@danro
Created October 25, 2012 02:06
Show Gist options
  • Save danro/3950062 to your computer and use it in GitHub Desktop.
Save danro/3950062 to your computer and use it in GitHub Desktop.
iphone media queries
/* iPhone 3 portrait */
@media (device-height: 480px) and (-webkit-max-device-pixel-ratio: 1) and (orientation:portrait) {
}
/* iPhone 3 landscape */
@media (device-height: 480px) and (-webkit-max-device-pixel-ratio: 1) and (orientation:landscape) {
}
/* iPhone 4 retina portrait */
@media (device-height: 480px) and (-webkit-min-device-pixel-ratio: 2) and (orientation:portrait) {
}
/* iPhone 4 retina landscape */
@media (device-height: 480px) and (-webkit-min-device-pixel-ratio: 2) and (orientation:landscape) {
}
/* iPhone 5 or iPod Touch 5th generation, portrait */
@media (device-height: 568px) and (-webkit-min-device-pixel-ratio: 2) and (orientation:portrait) {
}
/* iPhone 5 landscape */
@media (device-height: 568px) and (-webkit-min-device-pixel-ratio: 2) and (orientation:landscape) {
}
@shubelal
Copy link

For iPhone 5 is any other media query bcz i try above but not working.

@chsWeb
Copy link

chsWeb commented Sep 9, 2014

Time to add iPhone 6

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