简单的css3加载动画

html

1
<div class="donut"></div>

css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@keyframes donut-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.donut {
display: inline-block;
border: 4px solid rgba(0, 0, 0, 0.1);
border-left-color: #7983ff;
border-radius: 50%;
width: 30px;
height: 30px;
animation: donut-spin 1.2s linear infinite;
}

效果

css3-load