forcing website to show in portrait mode only code example

Example: forcing website to show in landscape mode only

<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>

Tags:

Css Example