css闪烁效果

css:

.flicker {
    /*background-color: #d7e3f6;*/
    background-color: white;
    animation-iteration-count: 3;
    animation: twinkle 0.3s infinite alternate;
    -webkit-animation-iteration-count: 3;
}

@keyframes twinkle {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

html:

<div class="flicker "></div>

 

效果图:

 

posted @ 2020-09-17 17:54  沉迷编程的程序员  阅读(260)  评论(0编辑  收藏  举报