<div class="scene">
  <div class="cube">
    <div class="side back">BACK</div>
    <div class="side top">TOP</div>
    <div class="side bottom">BOTTOM</div>
    <div class="side front">FRONT</div>
  </div>
</div>
.scene {
  width: 300px;
  height: 300px;
  margin: 75px auto 0;
  perspective: 1200px;
}

.cube {
  position: relative;
  width: 300px;
  height: 300px;
  transform-style: preserve-3d;
  animation: example 10s linear infinite;
}

.side {
  position: absolute;
  width: 300px;
  height: 300px;
  box-sizing: border-box;
  border: 5px solid #9aa;
  background-color: rgba(32, 170, 151, 0.5);
  padding: 120px 0;
  font: 50px/1 'Trebuchet MS', sans-serif;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
}

.back {
  transform: translateZ(-150px);
}
.top {
  transform: translateY(-150px) rotateX(90deg);
}
.bottom {
  transform: translateY(150px) rotateX(90deg);
}
.front {
  transform: translateZ(150px);
}
.top, .bottom {
  background-color: rgba(105, 136, 190, 0.5)
}

@keyframes example {
  100% { transform: rotateX(360deg); }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.