Skip to content

Instantly share code, notes, and snippets.

@ideefixe
Last active December 11, 2015 12:08
Show Gist options
  • Save ideefixe/4598306 to your computer and use it in GitHub Desktop.
Save ideefixe/4598306 to your computer and use it in GitHub Desktop.
iPhone Media Queries
<!-- iPhone 2G, 3G, 3GS Portrait -->
@media only screen and (device-width: 320px) and (orientation: portrait) and not (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for iPhone in Portrait Orientation */
}
<!-- iPhone 2G, 3G, 3GS Landscape -->
@media only screen and (device-width: 480px) and (orientation: landscape) and not (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for iPhone in Landscape Orientation */
}
<!-- iPhone 4, 4S Portrait -->
@media only screen and (device-width: 480px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for XX iPhone in Portrait Orientation */
}
<!-- iPhone 4, 4S Landscape -->
@media only screen and (device-width: 960px) and (orientation: landscape) and not (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for iPhone in Landscape Orientation */
}
<!-- iPhone 5 Portrait -->
@media screen and (device-height: 568px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for XX iPhone in Portrait Orientation */
}
<!-- iPhone 5 Landscape -->
@media screen and (device-height: 320px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for XX iPhone in Portrait Orientation */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment