本文实例讲述了css实现叶子形状loading效果的方法。分享给大家供大家参考。具体实现方法如下:: _7 n+ I9 ~& g |, E5 G
代码如下: d) R4 N. W3 j' Z2 w Z% V
<!doctype html>
! {: z, f4 R- P9 l1 j1 K! d<html> 2 h. b# X) B4 p) c& Y
<head>
* f* F! p0 k, Q+ i6 p3 g# ?( ^<style type=text/css>
( D1 W$ ^: T: j& [$ Z( {body{ background: #000;}
9 z6 }0 M* _: M$ a4 W* d; ?: i6 g.color1{ background: #fde515;}
3 W3 D6 K% q8 D% U.color2{ background: #00def2;}
) k) ?; l* B2 z@-webkit-keyframes loadrotate{
9 H* p8 {- h2 N& [from{ -webkit-transform:rotatez(0deg);} ; M- K- E% C t& r7 K1 P3 n
to{ -webkit-transform:rotatez(360deg);} + o1 X8 i0 b/ @+ e5 i5 i/ A
} 9 X- X& p1 O2 e X8 u9 `! g
@keyframes loadrotate{
4 y. h9 i3 z. f" ^& z' @3 Sfrom{ transform:rotatez(0deg);} $ A# a" R, s, L- D) r- u/ }: |
to{ transform:rotatez(360deg);} ! Q6 T; p4 t. Y% }' _" f
}
0 _) X+ ]; _2 U#loading{ width: 100px; height: 100px; position: absolute; left:50%; top:50%; margin-left:-50px; margin-top: -50px; -webkit-animation:loadrotate 3s linear infinite; -webkit-animation-fill-mode:both; animation:loadrotate 3s linear infinite; animation-fill-mode:both;}
/ ~. `0 M5 L( y* V" t g$ i#loading div{ width: 20px; height:30px; position: absolute;left:40px; top:35px; -webkit-transform:rotatez(0) translatex(60px) ; opacity: 1; border-radius: 50% 0; } + `3 @* @" Q7 ^
#loading div:nth-child(2){-webkit-transform:rotatez(36deg) translatex(60px) ; opacity: 0.8; } : x1 b- m6 t7 b) ]
#loading div:nth-child(3){-webkit-transform:rotatez(72deg) translatex(60px); opacity: 0.6; }
! x# |+ M: J6 C#loading div:nth-child(4){-webkit-transform:rotatez(108deg) translatex(60px); opacity: 0.4;}
! V: ]4 j6 l5 B: ?% r, N#loading div:nth-child(5){-webkit-transform:rotatez(144deg) translatex(60px) ; opacity: 0.2;} ( j" \! s: z; r8 ^: w
#loading div:nth-child(6){-webkit-transform:rotatez(180deg) translatex(60px) ; opacity: 1; }
' p1 L Q% Y% V- [4 i& e#loading div:nth-child(7){-webkit-transform:rotatez(216deg) translatex(60px) ; opacity: 0.8; }
4 \& z* C) u' V/ Q' q#loading div:nth-child(8){-webkit-transform:rotatez(252deg) translatex(60px) ; opacity: 0.6; }
* u! B& j; a. z& s3 P% a8 _4 L# a% `#loading div:nth-child(9){-webkit-transform:rotatez(288deg) translatex(60px) ; opacity: 0.4; } & z3 A6 ], S- U& ^% T' C! W8 J
#loading div:nth-child(10){-webkit-transform:rotatez(324deg) translatex(60px) ; opacity: 0.2; } 1 X9 b, a0 a; Q5 B F3 g: }& }
</style>
$ d1 {/ u: f1 Y</head> % \: O" Y4 t$ v
<body> 4 N$ b: Z- J; Z
<div id=loading> - _+ G$ Q$ g* R8 T- ~
<div class=color1></div> ; V; {1 ] q' E1 j" N7 L
<div class=color1></div> 4 i: \& `+ n- @
<div class=color1></div>
3 w( m1 E& Q3 I. h; H<div class=color1></div> . K6 S6 {6 k$ u1 u& u! K8 P
<div class=color1></div>
6 |* ^0 ?7 |. S) H/ ~2 D<div class=color2></div>
5 x' R' U) Q. W$ ~9 G<div class=color2></div> . v) y; D1 R R4 @: c
<div class=color2></div> H+ S0 M- Q. S) u& ~0 n
<div class=color2></div> + W4 s7 B7 S+ p
<div class=color2></div>
& p: A( r( f% i4 T4 {+ h</div>
6 d' |% S; Z+ P! s4 U) z7 f6 o</body>
& j8 K3 v9 j. R, `$ D: [) c</html>
$ ~9 e7 O/ T) l5 y: m运行效果如下图所示:
& J. |5 C }+ q2 ]" z2 u5 i+ Z3 |, B, @1 c1 e8 _9 ?
希望本文所述对大家的web前端设计有所帮助。
: j7 s" _+ P+ x+ O- ]& P
3 X% A8 _# h& A8 m& K% |5 A! Q% e更多网页制作信息请查看: 网页制作 |
|