Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS3 transform-origin Property Animation</title> <style> .container{ width: 125px; height: 125px; margin: 50px; perspective: 300px; border: 4px solid #a2b058; background: #f0f5d8; } .container img{ -webkit-animation: test 4s infinite; /* Chrome, Safari, Opera */ animation: test 4s infinite; /* Standard syntax */ } /* Chrome, Safari, Opera */ @-webkit-keyframes test { 50% { -webkit-transform: rotate3d(0, 1, 0, -180deg); /* Chrome, Safari, Opera */ -webkit-transform-origin: right center 0; } } /* Standard syntax */ @keyframes test { 50% { transform: rotate3d(0, 1, 0, -180deg); /* Standard syntax */ transform-origin: right center 0; } } </style> </head> <body> <p><strong>Warning:</strong> CSS Animations do not work in Internet Explorer 9 and earlier versions.</p> <p><strong>Note:</strong> The "club card" image is rotating 180 degree clockwise and its transform-origin is also animating form its initial value "50% 50% 0" to "right center 0", and back to the initial value "right center 0" again up to infinite times.<p> <div class="container"> <img src="/examples/images/club.jpg" alt="Club Card"> </div> </body> </html>