怎么用纯CSS3实现页面loading加载动画效果
更新:HHH   时间:2023-1-7


小编给大家分享一下怎么用纯CSS3实现页面loading加载动画效果,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

    实例示范:制作一个柱状动画加载效果,条纹由长变短再变长,具体代码如下:

    HTML部分:

    <divclass="box">

    <divclass="r1"></div>

    <divclass="r2"></div>

    <divclass="r3"></div>

    <divclass="r4"></div>

    <divclass="r5"></div>

    </div>

    CSS部分:

    .box{

    margin:100pxauto;

    width:50px;

    height:60px;

    }

    .box>div{

    background-color:#67CF22;

    height:100%;

    width:6px;

    display:inline-block;

    -webkit-animation:stretchdelay1.2sinfiniteease-in-out;

    animation:stretchdelay1.2sinfiniteease-in-out;

    }

    .box.r2{

    -webkit-animation-delay:-1.1s;

    animation-delay:-1.1s;

    }

    .box.r3{

    -webkit-animation-delay:-1.0s;

    animation-delay:-1.0s;

    }

    .box.r4{

    -webkit-animation-delay:-0.9s;

    animation-delay:-0.9s;

    }

    .box.r5{

    -webkit-animation-delay:-0.8s;

    animation-delay:-0.8s;

    }

    @-webkit-keyframesstretchdelay{

    0%,

    40%,

    100%{

    -webkit-transform:scaleY(0.4)

    }

    20%{

    -webkit-transform:scaleY(1.0)

    }

    }

    @keyframesstretchdelay{

    0%,

    40%,

    100%{

    transform:scaleY(0.4);

    -webkit-transform:scaleY(0.4);

    }

    20%{

    transform:scaleY(1.0);

    -webkit-transform:scaleY(1.0);

    }

    }


以上是“怎么用纯CSS3实现页面loading加载动画效果”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注天达云行业资讯频道!

返回web开发教程...