Skip to content

Instantly share code, notes, and snippets.

@felixzapata
Created October 10, 2012 07:56
Show Gist options
  • Save felixzapata/3863904 to your computer and use it in GitHub Desktop.
Save felixzapata/3863904 to your computer and use it in GitHub Desktop.
CSS media query to target iPad and iPad only
/*
* http://stackoverflow.com/questions/8271493/css-media-query-to-target-ipad-and-ipad-only
*/
@media all and (device-width: 768px) and (device-height: 1024px) and (orientation:portrait) {
.ipad-portrait { color: red; } /* your css rules for ipad portrait */
}
@media all and (device-width: 768px) and (device-height: 1024px) and (orientation:landscape) {
.ipad-landscape { color: blue; } /* your css rules for ipad landscape */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment