.loader{ height: 50px; width: 50px; margin: 20% auto 0 auto; }
.loader::after,.loader::before{ content: ""; width: 50px; height: 50px; position: absolute; border: solid 8px transparent; border-radius: 50%; -webkit-animation: circles 1.4s linear infinite; animation: circles 1.4s linear infinite; }
.loader::before { border-top-color: #48C8A2; border-bottom-color: #48C8A2; }
.loader::after { border-left-color: #ccc; border-right-color: #ccc; -webkit-animation-delay: 0.7s; animation-delay: 0.7s; }
@-webkit-keyframes circles {
0% {
-webkit-transform: rotate(0deg) scale(1);
transform: rotate(0deg) scale(1);
}
50% {
-webkit-transform: rotate(180deg) scale(1);
transform: rotate(180deg) scale(1);
}
100% {
-webkit-transform: rotate(360deg) scale(1);
transform: rotate(360deg) scale(1);
}
}
<div class="loader"></div>
效果图(有旋转效果):