FlyingCat
FlyingCat

Reputation: 14288

how to force ipad to landscape mode in my case

I am trying to force iPad web browser page and the browser to landscape mode when the user clicks a link.

I have something like

<div>
    <a ng-click="click me()" href="www.cnn.com">Click me</a>
</div>

I know I can add CSS like this

@media screen and (orientation: portrait){
    html {
        -webkit-transform: translateY(-100%) rotate(90deg);
        transform: translateY(-100%) rotate(90deg);
        -webkit-transform-origin: left bottom;
        transform-origin: left bottom;
    }
}

to transfer landscape mode. However, I was hoping to force entire iPad to landscape mode (meaning the browser address bar, tabs..etc will be switch to the side too not just webpage).

Is there anything I can do to accomplish this? Thanks a lot!

Upvotes: 1

Views: 383

Answers (1)

XeonFibre
XeonFibre

Reputation: 33

You can't basically. I know no one likes lectures and all but you should design your webpage to look brilliant in both portrait and landscape mode. Or, you could design something which asks them to rotate their screen... or do some JavaScript trickery as follows: Detect iPad orientation change

Upvotes: 2

Related Questions