首页 > 技术文章 > css实现图片360度旋转

chr506029589 2020-07-15 14:36 原文

1.图片效果(不能上传视频,只能截图了)

 2.css代码

 1 <template>
 2     <div calss="testImg">
 3       <div class="roundImg"></div>
 4     </div>
 5 </template>
 6 
 7 <style>
 8     .roundImg{
 9       width: 66%;
10       height: 66%;
11       position: absolute;
12       top: 22%;
13       left: 2%;
14       z-index: 1;
15       background:url("../../../assets/images/danger/dangerBg2.svg") no-repeat center center;
16       background-size: contain;
17       -webkit-animation: round_animate 5s linear infinite;
18       animation: round_animate 5s linear infinite; 
19     }
20     @keyframes round_animate {
21       to {
22         transform: rotate(1turn);
23       }
24     }
25 </style>

  提示:

 

推荐阅读