Created
January 8, 2020 01:12
-
-
Save felixprojekt/d9e554f52509fa99e4edc3b9f8af3969 to your computer and use it in GitHub Desktop.
hide-website-in-landscape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<style> | |
.rotate-device { | |
display: none; | |
} | |
@media (orientation: landscape) and (max-height: 500px) { | |
html, body { | |
margin: 0; | |
height: 100%; | |
overflow: hidden; | |
} | |
.rotate-device { | |
display: block; | |
position: absolute; | |
left: 0; | |
right: 0; | |
top: 0; | |
bottom: 0; | |
background: white; | |
z-index: 99999; | |
overflow: hidden; | |
text-align: center; | |
padding: 50px; | |
font-size: 2rem; | |
} | |
.rotate-device img { | |
height: 120px; | |
margin: 40px auto; | |
display: block; | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div class="rotate-device"> | |
<img src="img/turn_phone.png" alt="Rotate your device" /> | |
<p>Please rotate your device</p> | |
</div> | |
<h1>Website content</h1> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment