CSS3 元素转圈动画 (元素旋转动画)

谁践踏了优雅 2022-11-10 01:25 265阅读 0赞
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Document</title>
  6. <style type="text/css">
  7. .circle {
  8. width: 200px;
  9. height: 200px;
  10. position: absolute;
  11. top: 50%;
  12. left: 50%;
  13. margin: -100px 0 0 -100px;
  14. }
  15. .circle1,
  16. .circle2,
  17. .circle3,
  18. .center {
  19. position: absolute;
  20. left: 50%;
  21. top: 50%;
  22. margin: -30px 0 0 -30px;
  23. width: 60px;
  24. height: 60px;
  25. border-radius: 30px;
  26. background-color: #666666;
  27. }
  28. .center {
  29. position: absolute;
  30. left: 50%;
  31. top: 50%;
  32. margin: -35px 0 0 -35px;
  33. width: 70px;
  34. height: 70px;
  35. border-radius: 35px;
  36. background: #111111;
  37. text-align: center;
  38. line-height: 70px;
  39. color: #EAEAEA;
  40. font-size: 16px;
  41. }
  42. .circle1 {
  43. -webkit-animation: circle 3s linear infinite;
  44. animation: circle 3s linear infinite;
  45. }
  46. .circle2 {
  47. -webkit-animation: circle 3s linear 0.8s infinite;
  48. animation: circle 3s linear 0.8s infinite;
  49. }
  50. .circle3 {
  51. -webkit-animation: circle 3s linear 1.6s infinite;
  52. /* Safari and Chrome */
  53. animation: circle 3s linear 1.6s infinite;
  54. }
  55. @-webkit-keyframes circle {
  56. /* Safari and Chrome */
  57. from {
  58. opacity: 1;
  59. -webkit-transform: scale(0);
  60. }
  61. to {
  62. opacity: 0;
  63. -webkit-transform: scale(3);
  64. }
  65. }
  66. </style>
  67. </head>
  68. <body>
  69. <div class="circle">
  70. <div class="circle1"> </div>
  71. <div class="circle2"> </div>
  72. <div class="circle3"> </div>
  73. <div class="center"></div>
  74. </div>
  75. </body>
  76. </html>

发表评论

表情:
评论列表 (有 0 条评论,265人围观)

还没有评论,来说两句吧...

相关阅读