HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> #div1 { position: relative; height: 150px; width: 150px; margin-left: 100px; padding:40px; border: 1px solid green; -webkit-perspective: 200px; /* Safari 4-8 */ perspective: 200px; animation: myAnimation 2s infinite; -webkit-animation: myAnimation 2s infinite; /* Safari 4.0 - 8.0 */ } #div2{ padding: 50px; position: absolute; border: 1px solid #008066; background: #b3fff0; -webkit-transform-style: preserve-3d; /* Safari 3-8 */ -webkit-transform: rotateX(45deg); /* Safari 3-8 */ transform-style: preserve-3d; transform: rotateX(15deg); } @keyframes myAnimation { 50% {perspective-origin: 25px 100%;} } /* Safari 4.0 - 8.0 */ @-webkit-keyframes myAnimation { 50% {-webkit-perspective-origin: 25px 100%;} } </style> </head> <body> <h1>CSS Animatable perspective-origin</h1> <div id="div1">Div 1 <div id="div2">Div2</div> </div> </body> </html>
OUTPUT
×

Save as Private