JSFiddle - React, Tailwind, and code Playground

HTML

<div id="div1">
    <div id="div2" class="child">HELLO</div>
    <div id="div3" class="child">HELLO</div>
</div>

CSS

#div1 {
  position: relative;
  height: 150px;
  width: 200px;
    -webkit-transform: perspective(150px) rotateY(-30deg);
       -moz-transform: perspective(150px) rotateY(-30deg);
    -webkit-transform-style: preserve-3d;
       -moz-transform-style: preserve-3d;
}

.child {
  padding:50px;
  position: absolute;
}

#div2 {
  background-color: red;
}

#div3 {
  background-color: green;
  -moz-transform: translateZ(-50px);
  -webkit-transform: translateZ(-50px);
}