01.奔跑的少年.html 743 B

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <style>
  9. .box1{
  10. width: 256px;
  11. height: 256px;
  12. margin: 0 auto;
  13. background-image: url('./img/bg2.png');
  14. animation: run 1s steps(6) infinite;
  15. }
  16. /* 创建关键帧 */
  17. @keyframes run{
  18. from{
  19. background-position: 0 0;
  20. }
  21. to{
  22. background-position: -1536px 0;
  23. }
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div class="box1"></div>
  29. </body>
  30. </html>