forcing website to show in landscape mode only

Solutions on MaxInterview for forcing website to show in landscape mode only by the best coders in the world

showing results for - "forcing website to show in landscape mode only"
Haven
16 Mar 2020
1<style type="text/css">
2    #warning-message{ 
3      display: none; 
4	}
5    @media only screen and (orientation:portrait){
6        #wrapper { 
7          display:none; 
8      	}
9        #warning-message { 
10          display:block; 
11      	}
12    }
13    @media only screen and (orientation:landscape){
14        #warning-message{
15          display:none; 
16      }
17    }
18</style>
19
20....
21
22<div id="wrapper">
23    <!-- your html for your website -->
24</div>
25<div id="warning-message">
26    this website is only viewable in landscape mode
27</div>