Skip to content

Instantly share code, notes, and snippets.

@helderjnpinto
Forked from visnup/lock.css
Created June 8, 2017 09:43
Show Gist options
  • Select an option

  • Save helderjnpinto/35ac0cdb920128a7a453a3f857cfa9ec to your computer and use it in GitHub Desktop.

Select an option

Save helderjnpinto/35ac0cdb920128a7a453a3f857cfa9ec to your computer and use it in GitHub Desktop.
"lock" orientation of a website for mobile (iPad, iPhone)
/* if portrait mode is detected, rotate the entire site -90 degrees to hint rotating to landscape */
@media (orientation: portrait) {
body {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment