css3.0实现背景旋转的方法

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>
<style type="text/css">
/*css3.0 的从from 到to的改变 */
@-webkit-keyframes spin { 
    from { -webkit-transform: rotate(-55deg) }
    to { -webkit-transform: rotate(305deg) }
}
@-moz-keyframes spin{ 
    from { -moz-transform: rotate(-55deg) }
    to { -moz-transform: rotate(305deg) }
}
@-ms-keyframes spin { 
    from { -ms-transform: rotate(-55deg) }
    to { -ms-transform: rotate(305deg) }
}
/* t1 初始形态 */
#t1{
width:66px; 
height:66px;
background-image:url(https://img-blog.csdn.net/20130618151427656);
display: block;
    position: absolute;
    -moz-transform: rotate(-55deg);
    -webkit-transform: rotate(-55deg);
    -ms-transform: rotate(-55deg);
    /* webkit chrome, safari, mobile */
    -webkit-animation-name: spin;
    -webkit-animation-duration: 5000ms; /* 40 seconds */
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-timing-function: linear;
    /* ff */
    -moz-animation-name: spin;
    -moz-animation-duration: 5000ms; /* 40 seconds */
    -moz-animation-iteration-count: infinite;
    -moz-animation-timing-function: linear;
    /* ie */
    -ms-animation-name: spin;
    -ms-animation-duration: 5000ms; /* 40 seconds */
    -ms-animation-iteration-count: infinite;
    -ms-animation-timing-function: linear;
}






</style>
</head>


<body>
<div id="t1"></div>
<p>css的动画基本上可以说是已经可以独当一面了,呵呵。学习学习</p>
</body>
</html>
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值