Skip to content

Instantly share code, notes, and snippets.

@abernier
Created February 3, 2012 09:26
Show Gist options
  • Select an option

  • Save abernier/1729236 to your computer and use it in GitHub Desktop.

Select an option

Save abernier/1729236 to your computer and use it in GitHub Desktop.
CSS frame portrait
html {-webkit-perspective:800;}
body {width:100%; height:100%; position:relative;}
body, body * {-webkit-transform-style:preserve-3d;}
.cube,
.cube > * {display:block; width:100px; height:100px;}
.cube {position:relative;}
.cube > * {position:absolute; -webkit-backface-visibility:visible;}
.cube > .one {-webkit-transform:rotateX( 90deg) translateZ( 50px);}
.cube > .two {-webkit-transform: translateZ( 50px);}
.cube > .three {-webkit-transform:rotateY( 90deg) translateZ( 50px);}
.cube > .four {-webkit-transform:rotateY(180deg) translateZ( 50px);}
.cube > .five {-webkit-transform:rotateY(-90deg) translateZ( 50px);}
.cube > .six {-webkit-transform:rotateX(-90deg) translateZ( 50px) rotate(180deg);}
.frame-portrait > * {border:1px solid;}
<!DOCTYPE>
<html>
<head>
<meta charset=utf-8>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div class="frame-portrait cube">
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
<div class="four"></div>
<div class="five"></div>
<div class="six"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment