#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    769
    Rep Power
    41

    always present in portrait mode


    I need my web site to always display in portrait mode on an ipad, even if the user is holding the scree to be in landscape mode. Couldn't find the answer in a web search.

    Can anyone assist?

    thanks! : )
  2. #2
  3. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,434
    Rep Power
    9645
    It's currently not possible. Best you can do is alter the layout based on orientation (ie, with media queries).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    769
    Rep Power
    41

    thanks


    good to know, thanks: )
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Location
    Ahmedabad
    Posts
    17
    Rep Power
    0
    Hi,

    You have no control over the user moving the orientation however you can at least message them. This example will hide the wrapper if in portrait mode and show the warning message and then hide the warning message in landscape mode and show the portrait.

    Code:
    <style type="text/css">
        #warning-message { display: none; }
        @media only screen and (orientation:portrait){
            #wrapper { display:none; }
            #warning-message { display:block; }
        }
        @media only screen and (orientation:landscape){
            #warning-message { display:none; }
        }
    </style>
    
    ....
    
    <div id="wrapper">
        <!-- your html for your website -->
    </div>
    <div id="warning-message">
        this website is only viewable in landscape mode
    </div>

IMN logo majestic logo threadwatch logo seochat tools logo