<section class="container">
  <div id="cube">
    <figure class="back"></figure>
    <figure class="left"></figure>
    <figure class="bottom"></figure>
    <figure class="front"></figure>
    <figure class="right"></figure>
    <figure class="top"></figure>
  </div>
</section>
.container {
  width: 150px;
  height: 150px;
  margin: 50px auto;
  position: relative;
  perspective: 400px;
}

#cube {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
}

#cube figure {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 2px solid black;
}

#cube .back {
  background: hsla(0, 100%, 50%, 0.5);
  transform: rotateX(0deg) translateZ(-75px);
}

#cube .left {
  background: hsla(60, 100%, 50%, 0.5);
  transform: rotateY(90deg) translateZ(-75px);
}

#cube .bottom {
  background: hsla(120, 100%, 50%, 0.5);
  transform: rotateX(90deg) translateZ(-75px);
}

#cube .front {
  background: hsla(180, 100%, 50%, 0.5);
  transform: rotateX(0deg) translateZ(75px);
}

#cube .right {
  background: hsla(240, 100%, 50%, 0.5);
  transform: rotateY(90deg) translateZ(75px);
}

#cube .top {
  background: hsla(300, 100%, 50%, 0.5);
  transform: rotateX(90deg) translateZ(75px);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js