本文实例讲述了css实现叶子形状loading效果的方法。分享给大家供大家参考。具体实现方法如下:
2 F: ?/ X4 A5 \; y代码如下:
! M$ @* n5 _$ F* W1 F! e2 B<!doctype html> 1 q7 l$ L8 b$ Z+ R
<html> . u* V- O2 I1 A: l1 ^ I
<head>
/ `/ G3 N# J- S" e. h+ R<style type=text/css> 0 G( h! x- k: x: P: \; k
body{ background: #000;} & E/ q( d8 M3 }
.color1{ background: #fde515;} 1 i. m9 R# c' c7 f
.color2{ background: #00def2;}
x9 ?, J% W \7 R@-webkit-keyframes loadrotate{
% W8 }. D; ]3 T& s vfrom{ -webkit-transform:rotatez(0deg);}
# ] l$ r( K6 O$ `/ _to{ -webkit-transform:rotatez(360deg);}
: o0 H+ k4 h4 x3 i}
B; q7 n* ?2 J, G% R4 [7 }! G@keyframes loadrotate{ * Z* s) S0 o1 ?1 B" J
from{ transform:rotatez(0deg);}
/ Z% H: Q+ O& |3 C, L- q% g4 jto{ transform:rotatez(360deg);} $ ?4 J. s2 \/ C, @0 w/ T, ]
}
- a4 l; X( f9 w& V9 |' N#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;} 8 u! m4 v! G5 }% T$ w# }: q* F
#loading div{ width: 20px; height:30px; position: absolute;left:40px; top:35px; -webkit-transform:rotatez(0) translatex(60px) ; opacity: 1; border-radius: 50% 0; } & j1 N4 O+ {9 }6 W1 @
#loading div:nth-child(2){-webkit-transform:rotatez(36deg) translatex(60px) ; opacity: 0.8; }
1 X7 @2 i- t, C* d( u+ V#loading div:nth-child(3){-webkit-transform:rotatez(72deg) translatex(60px); opacity: 0.6; }
, B# K! [- s1 ?' {9 ?' b0 B#loading div:nth-child(4){-webkit-transform:rotatez(108deg) translatex(60px); opacity: 0.4;} C6 d. L/ G. z2 m
#loading div:nth-child(5){-webkit-transform:rotatez(144deg) translatex(60px) ; opacity: 0.2;}
* T2 t" D4 l) u% \. ^; Q#loading div:nth-child(6){-webkit-transform:rotatez(180deg) translatex(60px) ; opacity: 1; } ' M! x& g1 o0 L, n. h/ m4 V
#loading div:nth-child(7){-webkit-transform:rotatez(216deg) translatex(60px) ; opacity: 0.8; }
3 t9 N2 a0 e4 h& d/ {#loading div:nth-child(8){-webkit-transform:rotatez(252deg) translatex(60px) ; opacity: 0.6; } $ S6 k) O1 Y' F1 R
#loading div:nth-child(9){-webkit-transform:rotatez(288deg) translatex(60px) ; opacity: 0.4; } 5 T4 I9 e) C% I. U& C0 a, O
#loading div:nth-child(10){-webkit-transform:rotatez(324deg) translatex(60px) ; opacity: 0.2; } 5 s0 @" L6 t& m. Q2 y
</style> D7 `" ^" o) Y' U
</head>
$ |) U- V) V) W9 h+ P. I" d' I<body>
( F' H2 Z! ^6 h1 F<div id=loading>
3 J$ Q6 R& e& b5 ^. n<div class=color1></div> : d' S& _/ b' h4 E2 d* P1 f% i
<div class=color1></div>
; A" s$ X$ H/ J' X/ y% S4 r7 V3 O<div class=color1></div>
# c# n. D3 ?. l( F: A4 b e<div class=color1></div>
# u' b, ?) |. t; Q2 X: T* ]2 M<div class=color1></div>
2 }% ?; x( u- Q+ j' v5 I7 l<div class=color2></div>
) @0 y& F: n1 {<div class=color2></div> ( `* K+ ?. S. Q& h$ Z
<div class=color2></div> 4 Z7 r4 W4 D+ q4 |0 U- [
<div class=color2></div>
A. \( l/ Z' b# g9 U* o* Y: W<div class=color2></div>
8 m6 n* k. Q3 C* e" S</div> 3 ^. f9 k% Z- t# r1 E6 }8 J/ N! j
</body>
1 K/ t. c; |" n0 U& L+ Z1 S9 Z2 r</html>
$ V! B! u; Z0 o8 }9 y/ C/ W+ A0 x运行效果如下图所示:3 X ^, Q0 X# @. a! A; B
& F: t) l, ~) w希望本文所述对大家的web前端设计有所帮助。6 x }! ?) V% F5 ^0 I: I4 `) o( d
0 m; ~8 M+ I5 R; c# |" r H/ e4 W" |. }4 s4 n
更多网页制作信息请查看: 网页制作 |
|