本文实例讲述了css实现叶子形状loading效果的方法。分享给大家供大家参考。具体实现方法如下:
6 K" C" m! X. X! i/ z, i, ~* T代码如下: F7 t/ |2 j- k8 M; L4 z& B
<!doctype html>
$ N g& [' L. w1 i3 ~, u% v<html>
|" T- H4 g$ m9 h2 a<head>
! ~( i# I X+ F1 C2 g: {<style type=text/css> P: r+ _$ }7 h0 ?- B) E
body{ background: #000;}
. b S4 F' t9 {# v.color1{ background: #fde515;} ' P0 f- ]2 O' }
.color2{ background: #00def2;} / j8 e/ x! F4 e% q _% G: P
@-webkit-keyframes loadrotate{
; K/ }. z" I/ U4 t) L# ~9 N( y: _5 Afrom{ -webkit-transform:rotatez(0deg);} 8 B6 b9 [! m2 B$ f$ d2 W
to{ -webkit-transform:rotatez(360deg);} " f% F2 H" U% @
}
$ l& _, W$ n1 t1 g! r4 B@keyframes loadrotate{ 5 S/ Y" [+ X2 z% f) a E
from{ transform:rotatez(0deg);}
. N4 T' g/ G3 \$ W4 X' |2 Dto{ transform:rotatez(360deg);} 2 }: k" s4 _! J% t/ @( {' Z1 }! ]
} # h0 b7 M! ~$ e f. g, _* F- l
#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;} 3 f2 ^5 m |1 m; D4 S. R7 b
#loading div{ width: 20px; height:30px; position: absolute;left:40px; top:35px; -webkit-transform:rotatez(0) translatex(60px) ; opacity: 1; border-radius: 50% 0; }
$ D& L1 r- n/ ]9 x7 _# Q#loading div:nth-child(2){-webkit-transform:rotatez(36deg) translatex(60px) ; opacity: 0.8; }
* |/ a4 J# r* @% X+ D+ Z- Q#loading div:nth-child(3){-webkit-transform:rotatez(72deg) translatex(60px); opacity: 0.6; }
( o7 \5 M) A1 ?0 E- [& B#loading div:nth-child(4){-webkit-transform:rotatez(108deg) translatex(60px); opacity: 0.4;} * g9 |6 I; b; \- K& Z4 v7 Y
#loading div:nth-child(5){-webkit-transform:rotatez(144deg) translatex(60px) ; opacity: 0.2;}
$ Q& x% o% T) q. h$ Q5 ]4 }#loading div:nth-child(6){-webkit-transform:rotatez(180deg) translatex(60px) ; opacity: 1; } g4 l3 P5 w+ I0 r
#loading div:nth-child(7){-webkit-transform:rotatez(216deg) translatex(60px) ; opacity: 0.8; }
8 x" x! u9 T" l6 D' R" i0 b#loading div:nth-child(8){-webkit-transform:rotatez(252deg) translatex(60px) ; opacity: 0.6; }
$ b! L% I# y7 w+ \ o1 Z#loading div:nth-child(9){-webkit-transform:rotatez(288deg) translatex(60px) ; opacity: 0.4; } 7 J$ e1 K2 M9 |8 U' A& y9 U
#loading div:nth-child(10){-webkit-transform:rotatez(324deg) translatex(60px) ; opacity: 0.2; }
6 M& x# L; @; {" T4 `- S7 n</style> ! G4 ~0 x* R1 k' ]: A/ e
</head> 8 W; O. J, f1 o7 K; [3 W, _* o! u
<body>
& D/ I3 ]# A! C4 F& f2 N<div id=loading> 9 l( ~0 k) j5 I! c/ T. E
<div class=color1></div>
3 x S: {+ f& q) W# @$ W4 A<div class=color1></div>
' U0 W1 z) f2 N. V/ p) D& Q<div class=color1></div>
1 W$ H, E1 T0 b B<div class=color1></div>
- t8 d+ A; y6 q( [" Q& r<div class=color1></div>
5 f1 R+ e! E7 \<div class=color2></div>
, N2 \1 `2 f# E' } d# x2 _+ {+ G<div class=color2></div>
w! I2 `) d4 h8 t<div class=color2></div>
% d, k9 X6 A# {9 G4 m$ K3 h; a<div class=color2></div>
# A! b- u+ W. k# Y<div class=color2></div> 9 \' x8 i/ J& I- u$ j/ d; `
</div>
! x/ r$ I+ c4 P: A& \</body>
, V n2 g6 m. y7 l% c</html>2 V4 [( J6 a5 y" N: G4 B" }$ s
运行效果如下图所示:1 {' M- S5 U) q
& D- R# _3 ]( ]# e1 d+ N/ J' V' o希望本文所述对大家的web前端设计有所帮助。
5 J5 t" x3 S1 Q/ t2 G- y$ o
+ I0 b# I8 l) W5 a更多网页制作信息请查看: 网页制作 |
|