Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <style> #DIV1 { position: relative; height: 200px; width: 200px; margin: 100px; padding: 10px; border: 1px solid black; } #DIV2 { padding: 50px; position: absolute; border: 1px solid black; background-color: coral; -webkit-transform: rotateY(50deg); /* Chrome, Safari, Opera */ transform: rotateY(50deg); } #DIV3 { padding: 40px; position: absolute; border: 1px solid black; background-color: lightblue; -webkit-transform: rotateY(70deg); /* Chrome, Safari, Opera */ transform: rotateY(70deg); } </style> </head> <body> <p>Click the "Try it" button to preserve the 3D position of the child elements of the DIV2 element:</p> <button onclick="myFunction()">Try it</button> <div id="DIV1">DIV1 <div id="DIV2">HELLO DIV2 <div id="DIV3">HELLO DIV3</div> </div> </div> <script> function myFunction() { // Code for Chrome, Safari, Opera document.getElementById("DIV2").style.WebkitTransformStyle = "preserve-3d"; // Standard syntax document.getElementById("DIV2").style.transformStyle = "preserve-3d"; } </script> <p><b>Note:</b> Internet Explorer 10 and earlier versions do not support the transformStyle property.</p> <p><b>Note:</b> Chrome, Safari and Opera supports an alternative, theWebkitTransformStyle property.</p> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_style_transformstyle by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:26:01 GMT --> </html>
Result:
Try it Yourself - © w3schools.com