0
点赞
收藏
分享

微信扫一扫

CSS跳动文字

巧乐兹_d41f 2024-05-11 阅读 7
css前端

在这里插入图片描述

<div class="loading-mask">
        <div class="loading-text">
            <span style="--i:1"></span>
            <span style="--i:2"></span>
            <span style="--i:3"></span>
            <span style="--i:4">.</span>
            <span style="--i:5">.</span>
            <span style="--i:6">.</span>
        </div>
</div>
.loading-mask {
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: #000;
        .loading-text {
            font-size: 32px;
            color: #fff;
            span {
                display: inline-block;
                animation: jump 1.5s ease-in-out infinite;
                /* 利用变量设置延迟时间*/
                animation-delay: calc(.1s*var(--i)); 
            }
        }
}
@keyframes jump {
        0% {
            transform: translateY(0px);
        }
        20% {
            transform: translateY(-24px);
        }
        40%,
        100% {
            transform: translateY(0px);
        }
}
举报

相关推荐

【CSS】跳动文字

前端CSS实现跳动的文字

纯css实现阴影跳动

css 文字换行

css 文字渐变效果

css 文字溢出居中

0 条评论