I want to force an iPad to show a website only in landscape mode?
Is this possible?
I want to force an iPad to show a website only in landscape mode?
Is this possible?
You can set it with CSS:
@media only screen and (orientation:portrait){
html body * {
display:none;
}
}
@media only screen and (orientation:landscape){
/* your CSS */
}
In the portait mode all elemnts will be hidden. You can set a <div>Switch to landscape</div>
to be only displayed in portait mode
Safari's interface will still be in portrait mode and it's having issues with setting the height to 100% but you could rotate the entire html element when in portrait mode like this
html, body {
height: 100%;
}
@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;
}
}