Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <div class="a">
    <div class="red">
      red
    </div>
    
    <div class="orange">
      orange
    </div>
    
    <div class="yellow">
      yellow
    </div>
    
    <div class="green">
      green
    </div>
  </div>
</body>
</html>
 
* {
  margin:0;
  padding:0;
}
.a {
  width:500px;
  margin:100px auto;
  -webkit-perspective:400px;
   -moz-perspective:400px;
   perspective:400px;
}
.a>div  {
  width: 100px;
  height: 200px;
  
  float:left;
  border:double 3px white;
  text-align:center;
  font: bold 1.2em/200px "Lucida Sans";
  
  -webkit-backface-visibility:hidden;
  -moz-backface-visibility:hidden;
  backface-visibility:hidden;
  
  box-shadow:4px 5px 9px #444;
  -webkit-box-shadow:4px 5px 9px #444;
  -moz-box-shadow:4px 5px 9px #444;
  
  position:relative;
  z-index:6;
}
.a>div:after {
  
  content:"";
  position: absolute;
  
  top:101%;
  left:-3px;
  width:100%;
  height:20%;
  background:#444;
  background: 
    linear-gradient(rgba(10,10,10,0.8), 
    rgba(50,50,50,0.3));
  box-shadow:0 0 9px rgba(50,50,50,0.3);
  
  z-index:-1;
}
.red {
  background:red;
  color:white;
  
  -webkit-transform-origin: 100% 0;
  -moz-transform-origin: 100% 0;
  transform-origin: 100% 0;
  
  -webkit-transform:
    rotateX(-30deg);
  
    transform:
    rotateX(-30deg);
    -moz-transform:
    rotateX(-30deg);
}
.red:after {
  content:none!important;
}
.orange {
  background:orange;
  color:white;
  -webkit-transform-origin:0 0;
  -webkit-transform:rotateY(30deg);
  
    -moz-transform-origin:0 0;
  -moz-transform:rotateY(30deg);
  
    transform-origin:0 0;
   transform:rotateY(30deg);
  
}
.orange:after {
  
  -webkit-transform-origin:0 0;
  -webkit-transform: rotateZ(-45deg) skewY(45deg);
  
    -moz-transform-origin:0 0;
  -moz-transform: rotateZ(-45deg) skewY(45deg);
  
    transform-origin:0 0;
  
  transform: rotateZ(-45deg) skewY(45deg);
  
  height:70%!important;
 
}
.yellow {
  background:yellow;
  color:#f8a;
  margin-left:-30px;
  border-color:#faf!important;
   -webkit-transform-origin:100% 100%;
  -webkit-transform:rotateY(-30deg);
  
     -moz-transform-origin:100% 100%;
  -moz-transform:rotateY(-30deg);
  
     transform-origin:100% 100%;
   transform:rotateY(-30deg);
}
.yellow:after {
  height:20px!important;
}
.green {
  background:green;
  color:white;
  -webkit-transform-origin:0 0;
  -webkit-transform:rotateX(30deg);
  
    -moz-transform-origin:0 0;
  -moz-transform:rotateX(30deg);
  
    transform-origin:0 0;
  transform:rotateX(30deg);
  
}
.green:after {
  height:30px!important;
  
  left:5%!important;
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
dmkimpro
0viewers