首页 > 开发 > CSS > 正文

纯HTML5+CSS3制作图片旋转

2024-07-11 08:29:38
字体:
来源:转载
供稿:网友

此实例可以应用到许多项目中,很实用,希望大家可以掌握。

效果图如下:


这个效果实现起来其实并不困难,代码清单如下:

XML/HTML Code复制内容到剪贴板
  1. <!DOCTYPE html>      <html lang="en">     
  2. <head>          <meta charset="UTF-8">     
  3.     <title>Document</title>          <style type="text/css">     
  4.         #liu{                  width:280px;     
  5.             height: 279px;                  background: url(shishi.png) no-repeat;     
  6.             border-radius:140px;                  -webkit-animation:run 6s linear 0s infinite;     
  7.         }           
  8.         #liu:hover{                  -webkit-animation-play-state:paused;     
  9.         }           
  10.               @-webkit-keyframes run{     
  11.             from{                      -webkit-transform:rotate(0deg);     
  12.             }                  to{     
  13.                 -webkit-transform:rotate(360deg);                  }     
  14.         }           
  15.     </style>      </head>     
  16. <body>          <div id="liu"></div>     
  17. </body>      </html>     
  18.   
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表