CSS如何让一个DIV可以旋转

 时间:2024-10-12 16:50:03

1、写好一个需要旋转的DIV如下:<div id="xuanzhun" style="width: 30px; height: 30px; background-color: aquamarine;"></div>

CSS如何让一个DIV可以旋转

2、将此DIV的样式写好如下:#xuanzhun{-webkit-transition-property: -webkit-transform;-webkit-transition-duration: 1s;-moz-transition-property: -moz-transform;-moz-transition-duration: 1s;-webkit-animation: rotate 3s linear infinite;-moz-animation: rotate 3s linear infinite;-o-animation: rotate 3s linear infinite;animation: rotate 3s linear infinite;}样式写好还不能旋转,图跟DIV图是一样的

CSS如何让一个DIV可以旋转

3、旋转动画代码如下:@-webkit-keyframes rotate{from{-web氯短赤亻kit-transform: r泠贾高框otate(0deg)}to{-webkit-transform: rotate(360deg)}}@-moz-keyframes rotate{from{-moz-transform: rotate(0deg)}to{-moz-transform: rotate(359deg)}}@-o-keyframes rotate{from{-o-transform: rotate(0deg)}to{-o-transform: rotate(359deg)}}@keyframes rotate{from{transform: rotate(0deg)}to{transform: rotate(359deg)}}设置好后,就可以旋转了。

CSS如何让一个DIV可以旋转
  • 海岛探险怎么玩
  • 江湖悠悠第九关完美攻略
  • 遇见逆水寒怎么捏脸 捏脸的方法
  • 摩尔庄园中怎么得到花礼拱门
  • 手机游戏割绳子level8-17三星攻略
  • 热门搜索
    五一手抄报内容 友善手抄报 防地震手抄报 元宵节手抄报 一等奖 爱的手抄报 安全手抄报内容资料 爱劳动手抄报 手抄报图片花边 尊老爱幼手抄报 反腐倡廉手抄报