html – 延迟的CSS内容

前端之家收集整理的这篇文章主要介绍了html – 延迟的CSS内容前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用CSS内容属性在html标记之前添加内容.
span::before {
    content: 'content that needs a delay';
}
<span></span>

有没有办法延迟内容的可见性(使用CSS)?

解决方法

span::before {
    content: 'content that needs a delay';
     margin-top: 25px;
    font-size: 21px;
    text-align: center;
    animation: fadein 4s;
    -moz-animation: fadein 4s; /* Firefox */
    -webkit-animation: fadein 4s; /* Safari and Chrome */
    -o-animation: fadein 4s; /* Opera */

}

@keyframes fadein {
    from {
        opacity:0;
    }
    to {
        opacity:1;
    }
}
@-moz-keyframes fadein { /* Firefox */
    from {
        opacity:0;
    }
    to {
        opacity:1;
    }
}
@-webkit-keyframes fadein { /* Safari and Chrome */
    from {
        opacity:0;
    }
    to {
        opacity:1;
    }
}
@-o-keyframes fadein { /* Opera */
    from {
        opacity:0;
    }
    to {
        opacity: 1;
    }
}
<span></span>

猜你在找的HTML相关文章