Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
When building an iPhone Web App can I control the orientaion to be portrait only?
in how_to by (210 points)
retagged by
  

1 Answer

0 votes
 
Best answer

Hi Pete,

Unfortunately, there is no way to control this on a Web App or web site.


There's a way to fake this with CSS. Source:
https://css-tricks.com/snippets/css/orientation-lock/

(I have not yet tested this)

@media screen and (orientation: landscape) { 
   html { 
      transform: rotate(-90deg); 
      transform-origin: left top; 
             width: 100vh; 
             overflow-x: hidden; 
             position: absolute; 
             top: 100%; left: 0; 
   } 
}
by (197k points)
edited by
I'm considering making this a feature at some point as well.