Skip to content

Instantly share code, notes, and snippets.

@jklm313
Created July 22, 2013 16:14
Show Gist options
  • Select an option

  • Save jklm313/6055177 to your computer and use it in GitHub Desktop.

Select an option

Save jklm313/6055177 to your computer and use it in GitHub Desktop.
Untitled
* {
position: relative;
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
background: white;
}
body {
background: #222;
text-align: center;
overflow: hidden;
}
.container {
display: inline-block;
transform-origin: 50% 50%;
margin-top: -50%;
transform: rotate(-90deg) translateX(-50%);
border: 3px solid red;
}
<div class='container'></div>
var supportsOrientationChange = 'onorientationchange' in window, orientationEvent = supportsOrientationChange ? 'orientationchange' : 'resize';
var $container = document.getElementsByClassName('container')[0];
$container.style.width = window.innerHeight + 'px';
$container.style.height = window.innerWidth + 'px';
window.addEventListener(orientationEvent, function() {
$container.style.width = window.innerHeight + 'px';
$container.style.height = window.innerWidth + 'px';
}, false);
{"view":"separate","fontsize":"100","seethrough":"1","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment