Css 闪烁效果_Css3 闪烁动画效果

Css 闪烁效果_Css3 闪烁动画效果

 

1. 方案1,:befor:after +animation

css

  .block {
            width: 400px;
            height: 300px;
            padding: 50px;
            border: 1px solid red;
            /* background: #000735; */
        }

        @keyframes twinkling {
            0% {
                opacity: 0.2;
                filter: alpha(opacity=20);
                transform: scale(1);
            }

            50% {
                opacity: 0.5;
                filter: alpha(opacity=50);
                transform: scale(1.12);
            }

            100% {
                opacity: 0.2;
                filter: alpha(opacity=20);
                transform: scale(1);
            }
        }


        .circle {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: #3a96e1;
            text-align: center;
            font-weight: bold;
            position: relative;
            line-height: 100px;
            z-index: 1;
        }

        .circle::before {
            background: inherit;
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            left: 0;
            top: 0;
            z-index: -2;
            border-radius: 50%;
            animation: twinkling 2.2s ease-in-out infinite;
        }

        .circle::after {
            background: inherit;
            content: '';
            position: absolute;
            width: 110%;
            height: 110%;
            left: -5%;
            top: -5%;
            z-index: -1;
            border-radius: 50%;
            animation: twinkling 2.2s ease-in-out infinite;
        }

        .circle2 {
            margin-top: 50px;
            width: 80px;
            height: 80px;
            line-height: 80px;
            font-size: 12px;
            background: #d67c61;
        }
View Code

 

html

    <div class="block">
        <div class="circle">千乐微云</div>
        <div class="circle circle2">小程序开发</div>
    </div>

 

展示效果:

 

2.方案2

待完善

 

更多:

Css 左右循环动画_左右循环运动效果案例

 CSS3 进度条布局整理

Css3 实现全圆进度条展示功能

posted @ 2021-09-25 17:57  天马3798  阅读(4434)  评论(0编辑  收藏  举报