纯CSS3的loading图案

转自:http://www.cssplay.co.uk/menu/cssplay-loading-animation.html


<div class="loading one"></div>
<div class="loading2 three"></div>

<style>
div.loading {width:200px; height:200px; position:relative; float:left; margin:0 10px;}
div.one {background:#09c;}

div.loading:after {display:block; content:"";
border-radius:2px;
height:2px; width:2px;
position:absolute;
margin:auto; left:0; top:0; right:0; bottom:0;
box-shadow:
10px 0 0 2px #eee,
7px 7px 0 2px #555,
0 10px 0 2px #555,
-7px 7px 0 2px #555,
-10px 0 0 2px #555,
-7px -7px 0 2px #888,
0 -10px 0 2px #ccc,
7px -7px 0 2px #ddd;

-webkit-animation:rotate 0.8s steps(8) infinite;
-o-animation:rotate 0.8s steps(8) infinite;
animation:rotate 0.8s steps(8) infinite;
}

@keyframes rotate {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}

@-webkit-keyframes rotate {
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}

@-o-keyframes rotate {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(360deg);}
}

/* second method */
div.loading2 {width:200px; height:200px; position:relative; float:left; margin:0 10px;}
div.three {background:#222;}

div.loading2 {width:200px; height:200px; background:#222; position:relative;}
div.loading2:before,
div.loading2:after {position:absolute; margin:auto; z-index:10; left:0; top:0; right:0; bottom:0; content:""; display:block; width:20px; height:20px; border:5px solid #fff; border-color:rgba(255,255,255,0.6) rgba(255,255,255,0.08) rgba(255,255,255,0.1) rgba(255,255,255,0.2) ; border-radius:200px;
}
div.loading2:before {
-webkit-animation:rotate1 1s steps(8) infinite;
-o-animation:rotate1 1s steps(8) infinite;
animation:rotate1 1s steps(8) infinite;
}
div.loading2:after {
-webkit-animation:rotate2 1s steps(8) infinite;
-o-animation:rotate2 1s steps(8) infinite;
animation:rotate2 1s steps(8) infinite;
}

@keyframes rotate1 {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}

@-webkit-keyframes rotate1 {
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}

@-o-keyframes rotate1 {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(360deg);}
}

@keyframes rotate2 {
from {transform: rotate(-45deg);}
to {transform: rotate(315deg);}
}

@-webkit-keyframes rotate2 {
from {-webkit-transform: rotate(-45deg);}
to {-webkit-transform: rotate(315deg);}
}

@-o-keyframes rotate2 {
from {-o-transform: rotate(-45deg);}
to {-o-transform: rotate(315deg);}
}

</style>


[img]http://dl2.iteye.com/upload/attachment/0095/3424/e3bd1a70-f368-3d8d-9d3d-820e43703a32.png[/img]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值