问题
Hi there i created a responsive mobile website using this:
max-width(480px) {etc..}
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
For every mobile device the website looks the same => great.
But when i change to landscape there is more than 480px and the website-variation of the desktop displays.
Is there any possibility to disable the auto-rotate or to show the portrait-mode on mobile-device even if there is more than 480px?
Greetings
回答1:
You can try and target specific orientation with your media query:
@media max-width(600px) and (orientation: landscape) {
rules for landscaped devices...
}
More on media queries:
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries
回答2:
Change your media query to a higher value?
max-width(600px) {etc..}
来源:https://stackoverflow.com/questions/24535361/disable-landscape-mode-for-mobile-devices