CodePen

HTML

            
              <div class="wrap">
    <div class="parent">
      <div class="one"></div>
      <div class="two"></div>
    </div>
</div>

<button>toggle transform-style</button>
            
          
!

CSS

            
              button {
  display: block;
  margin: 20px auto;
  padding: 5px 20px;
}

.wrap {
  position: relative;
  height: 200px;
  width: 200px;
  margin: 10px auto;
  background: transparent;
  perspective: 600;
}

.parent {
  margin: 10px;
  width: 150px;
  height: 150px;
  background-color: aquamarine;
  transform-style: preserve-3d;
  transform: rotateY(245deg);
}

.parent-flat {
  transform-style: flat; 
}

.parent > div {
  position: absolute;
  top: 30px;
  left: 30px;
  width: 150px;
  height: 150px;
  box-sizing: border-box;
}

.one {
  background-color: goldenrod;
  transform: translateZ(-100px) rotateY(45deg);
}

.two {
  background-color: green;
  transform: translateZ(50px) rotateX(20deg);
  transform-origin: 50% top;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              $('button').click(function () {

  $('.parent').toggleClass('parent-flat');

});
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................