animation blink 实现闪烁效果

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        a {
            text-decoration: none;
        }

        .an {
            -webkit-animation: .5s infinite blink;
            animation: .5s infinite blink
        }

        .commodity-sign-wrap {
            animation: blink 1s infinite;
            -webkit-animation: blink 1s infinite;
            /*Safari and Chrome*/
        }

       @keyframes blink{0%,100%{color:red}50%{color:#ff0}}
       @-webkit-keyframes blink{0%,100%{color:red}50%{color:#ff0}}

        @keyframes blink1 {
            0% {
                opacity: 0;
            }

            50% {
                opacity: 100;
            }

            100% {
                opacity: 0;
            }
        }

        @-webkit-keyframes blink1 {
            0% {
                opacity: 0;
            }

            50% {
                opacity: 100;
            }

            100% {
                opacity: 0;
            }
        }
    </style>
</head>

<body>
    <a href="" class="an" blink>最新优惠</a>
</body>

</html>

猜你喜欢

转载自blog.csdn.net/huawuque004/article/details/84350724