一个简易的loading加载图

315 阅读1分钟

htlm

<div class="loading"></div>   

css

.loading{
    width: 100px;
    height: 100px;
    border: 1px solid blue;
    position: relative;
}
.loading::before,.loading::after {
    content:"";
    width:0px;
    height: 0px;
    border-radius: 50%;
    background-color: #000;
    animation: loading 1.5s linear infinite;
    position: absolute;
    left:0;
    top:0;
    bottom:0;
    right:0;
    margin:auto;
}
.loading::after{
    animation-delay: 0.75s;
}
@keyframes loading{
    0%{
        width: 0;
        height:0;
        opacity: 1;
    }
    100%{
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}