示例现场演示<html> <head> <style> .animated { background-image: url(/css/images/logo.png); background-repeat: no-repeat; background-position: left top; padding-top:95px; margin-bottom:60px; -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-fill-mode: both; animation-fill-mode: both; } @-webkit-keyframes flipinx { 0% { -webkit-transform: perspective(400px) rotatex(90deg); opacity: 0; } 40% { -webkit-transform: perspective(400px) rotatex(-10deg); } 70% { -webkit-transform: perspective(400px) rotatex(10deg); } 100% { -webkit-transform: perspective(400px) rotatex(0deg); opacity: 1; } } @keyframes flipinx { 0% { transform: perspective(400px) rotatex(90deg); opacity: 0; } 40% { transform: perspective(400px) rotatex(-10deg); } 70% { transform: perspective(400px) rotatex(10deg); } 100% { transform: perspective(400px) rotatex(0deg); opacity: 1; } } .flipinx { -webkit-backface-visibility: visible !important; -webkit-animation-name: flipinx; backface-visibility: visible !important; animation-name: flipinx; } </style> </head> <body> <div id = "animated-example" class = "animated flipinx"></div> <button onclick = "myfunction()">reload page</button> <script> function myfunction() { location.reload(); } </script> </body></html>
以上就是使用 css 翻转 x 动画效果的详细内容。
