加载动画之线条伸缩


HTML部分

<div class="loading-container">
    <span class="loading-line"></span>
    <span class="loading-line"></span>
    <span class="loading-line"></span>
</div>


CSS部分

<style>
loading-container {
    padding: 60px;
    display: flex;
    align-items: center;
    height: 40px;
}

.loading-line {
    display: inline-block;
    width: 8px;
    height: 20px;
    background-color: dodgerblue;
    margin: 0 4px;
    box-shadow: 5px 5px 3px #a495e0db;
}

.loading-line:first-child {
    animation: higher 1.2s ease-out infinite alternate;
}
.loading-line:nth-child(2) {
    animation: higher 1.2s ease-out infinite .4s alternate;
}
.loading-line:nth-child(3) {
    animation: higher 1.2s ease-out infinite .8s alternate;
}

@keyframes higher {
    from {
        height: 20px;
    }
    to {
        height: 40px;
    }
}
</style>

您阅读这篇文章共花了: 0小时00分10秒
本博客所有文章如无特别注明均为原创。作者:fyq复制或转载请以超链接形式注明转自 免费精品资源分享
原文地址《加载动画之线条伸缩
生成文章海报

相关推荐

发表评论

路人甲 表情
Ctrl+Enter快速提交

网友评论(0)