使用css实现loading的加载

使用css实现loading的加载的效果图

html代码

 1     <div id="caseVerteClaire">
 2         <div id="transform">
 3           <div id="transform1"></div>
 4           <div id="transform2"></div>
 5           <div id="transform3"></div>
 6         </div>
 7          <div id="load">
 8           <p>loading</p>
 9         </div>
10       </div>

css代码

 1    #caseVerteClaire {
 2   background-color : #C9F76F;
 3   height : 140px;
 4   width : 150px;
 5   padding-top : 10px;
 6   float : left;
 7   position : relative;
 8 }
 9 #caseVerteClaire #load {
10   color : #444444;
11   font-family : calibri;
12   text-align : center;
13   position : absolute;
14   top : 42px;
15   left :42px;
16 }
17 #tranform {
18   position : absolute;
19   top : 85px;
20   left : 30px;
21 }
22 
23 #transform1 {
24   height : 30px;
25   width : 30px;
26   border-radius : 50%; 
27   background-color : #444444;
28   position : absolute;
29   top : 85px;
30   left : 15px;
31   opacity : 0;
32   animation : transform 4s infinite;
33   -webkit-animation : transform 4s infinite;
34 }
35 
36 #transform2 {
37   height : 30px;
38   width : 30px;
39   border-radius : 50%; 
40   background-color : #444444;
41   position : absolute;
42   top : 85px;
43   left : 54px;
44   opacity : 0;
45   animation : transform 4s infinite;
46   -webkit-animation : transform 4s infinite;
47   animation-delay : 0.5s;
48   -webkit-animation-delay : 0.5s;
49 }
50 
51 #transform3 {
52   height : 30px;
53   width : 30px;
54   border-radius : 50%; 
55   background-color : #444444;
56   position : absolute;
57   top : 85px;
58   left : 94px;
59   opacity : 0;
60   animation : transform 4s infinite;
61   -webkit-animation : transform 4s infinite;
62   animation-delay : 1s;
63   -webkit-animation-delay : 1s;
64 }
65 
66 @-webkit-keyframes transform {
67   0% {opacity : 0;}
68   25% {opacity : 1;}
69   50% {opacity : 0;}
70   75% {opacity : 1;}
71   100% {opacity : 0;}
72 }
73 
74 @keyframes transform {
75   0% {border-radius : 0px; opacity : 0;}
76   20% {border-radius : 0px; opacity : 1;}
77   40% {border-radius : 0px; opacity : 0;}
78   60% {border-radius : 50%; opacity : 0;}
79   80% {border-radius : 50%; opacity : 1;}
80   100% {border-radius : 50%; opacity : 0;}
81 }

 

posted @ 2020-03-09 19:36  jack杰克  阅读(630)  评论(0)    收藏  举报