首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HTML CSS对文本的加载效果

HTML CSS对文本的加载效果
EN

Stack Overflow用户
提问于 2018-05-23 07:59:23
回答 1查看 2K关注 0票数 1

我已经看到一些网站使用了一行文本加载的效果。我找了很多东西,但找不到什么叫什么。

效果:

是否有任何插件或css文件为这一效果,如引导。

我知道这个问题有点傻,但是我不知道在哪里问这个问题,我搜索到了在哪里问Html/CSS问题。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-05-23 08:03:59

这很接近你想要的东西。它只使用CSS/HTML完成,您可以很容易地根据自己的口味定制它

https://jsfiddle.net/hau122w8/

代码语言:javascript
复制
<div class="timeline-item">
    <div class="animated-background">
        <div class="background-masker content-first"></div>
        <div class="background-masker content-top"></div>
        <div class="background-masker content-first-end"></div>
        <div class="background-masker content-second-line"></div>
        <div class="background-masker content-second-end"></div>
        <div class="background-masker content-third-line"></div>
        <div class="background-masker content-third-end"></div>
    </div>
</div>

.timeline-item {
    background-color: #fff;
    border: 1px solid;
    border-color: #ddd;
    border-radius: 3px;
    padding: 12px;
    margin: 0 auto;
}

@keyframes placeHolderShimmer {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 10000px 0;
    }
}

.animated-background {
    animation-duration: 10s;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-name: placeHolderShimmer;
    background: #f6f7f8;
    background: linear-gradient(to right, #eeeeee 8%, #aacfde 18%, #eeeeee 33%);
    height: 96px;
    position: relative;
}

.background-masker {
    background: #fff;
    position: absolute;
}

    /* Every thing below this is just positioning */

    .background-masker.content-top,
    .background-masker.content-second-line,
    .background-masker.content-third-line,
    .background-masker.content-second-end,
    .background-masker.content-third-end,
    .background-masker.content-first-end {
        top: 40px;
        left: 0;
        right: 0;
        height: 6px;
    }

    .background-masker.content-first {
        height: 10px;
        top: 15px;
        left: 0;
        right: 0;
    }

    .background-masker.content-top {
        height: 20px;
    }

    .background-masker.content-first-end,
    .background-masker.content-second-end,
    .background-masker.content-third-end {
        width: auto;
        left: 380px;
        right: 0;
        top: 60px;
        height: 8px;
    }

    .background-masker.content-second-line {
        top: 68px;
    }

    .background-masker.content-second-end {
        left: 420px;
        top: 74px;
    }

    .background-masker.content-third-line {
        top: 82px;
    }

    .background-masker.content-third-end {
        left: 300px;
        top: 88px;
    }
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50482927

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档