简体   繁体   中英

Override orientation shift on a mobile device

I'm sure the answer varies from platform to platform, but is there any way to override a phone's ability to switch from portrait to landscape when you turn the phone? I've noticed apps doing this (eg. Instagram) but I'd like to implement this on a mobile version of website.

Anybody know of a way to do this?

So, apparently this is possible with the @viewport css meta selector . So:

@viewport{
    orientation: landscape;
}

I have no idea how well supported this is nor, it seems, do Mozilla. I'd eat my hat if it works consistently!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM