用css实现一个硬币旋转的效果
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .coin { width: 100px; height: 100px; margin: 100px; animation: rotateCoin 3s linear; animation-iteration-count: 3; background-color: goldenrod; border-radius: 50%; } .coin:hover { animation-play-state: paused; } @keyframes rotateCoin { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(360deg); } } </style> </head> <body> <div class="coin"></div> </body> </html>