Created
November 15, 2011 17:21
-
-
Save mhairston/1367673 to your computer and use it in GitHub Desktop.
Device Orientation Detection in CSS
This file contains 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
/* Device-specific styles: | |
If it’s important to deliver a very specific design to a very specific device (ie: a web application built specifically for the iPad), you can use Media queries to deliver styles to exact resolutions: | |
*/ | |
<!-- iPad specific styles --> | |
<link rel="stylesheet" href="iPad.css" type="text/css" media="only screen and (max-device-width:1024px) and (min-device-width:768px)" /> | |
Orientation-specific styles: | |
<!-- Orientation styles for devices w/ max width of 1024px --> | |
<link rel="stylesheet" href="portrait.css" type="text/css" media="only screen and (max-device-width:1024px) and (orientation:portrait)" /> | |
<link rel="stylesheet" href="landscape.css" type="text/css" media="only screen and (max-device-width:1024px) and (orientation:landscape)" /> | |
/* from: http://www.uxbooth.com/blog/considerations-for-mobile-design-part-2-dimensions/ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment