CSS to detect screen orientation:
@media screen and (orientation:portrait) { … }
@media screen and (orientation:landscape) { … }
The CSS definition of a media query is at http://www.w3.org/TR/css3-mediaqueries/#orientation
More Related Contents:
- Media Queries: How to target desktop, tablet, and mobile?
- Do we have to use non-standard/browser specific CSS vendor prefixes anymore?
- How to force browser to show image 3 inches wide?
- How to encode the filename parameter of Content-Disposition header in HTTP?
- CSS @media print issues with background-color;
- Common breakpoints for media queries on a responsive site
- Should I use max-device-width or max-width?
- Browsers’ default CSS stylesheets
- iPhone 5 CSS media query
- What are the rules for CSS media query overlap?
- What is use of ‘initial’ value in CSS?
- Media Queries for Different zoom Levels of Browser
- How can I disable a browser or element scrollbar, but still allow scrolling with wheel or arrow keys?
- Browser Caching of CSS files
- @Media min-width & max-width
- Print directly from browser without print popup window [duplicate]
- Browser support for CSS :first-child and :last-child
- How do I make Firefox auto-refresh on file change?
- CSS Media Query – Soft-keyboard breaks css orientation rules – alternative solution?
- How to detect if the OS is in dark mode in browsers?
- How to code CSS media queries targeting ALL mobile devices and tablets?
- How to control number of items per row using media queries in Flexbox?
- Can websites tell what addons/extensions are installed in a web browser?
- Single vs multiple stylesheets in responsive web design
- @media queries and image swapping [closed]
- @import styles not working in a media query
- Media queries and background images
- word document viewer browser plugin
- How to check if a CSS property or value is supported by a browser?
- The difference between HTML media queries and CSS media queries