css实现div背景色闪烁效果

我们先来看下效果图:

<img alt=\"CSS实现div背景色闪烁效果\” alt=\”5a76aec1a48282199b653acd02ffcc3.png\” src=\”https://www.freexyz.cn/d/file/20201027/903ddbb802037361eb7cd3c785014da8.png\” title=\”1603790670459659.png\” />

代码实现:

<!DOCTYPE html>
<html>
<head>
<style>
@keyframes fade {
    from {
        opacity: 1.0;
    }
    50% {
        opacity: 0.0;
    }
    to {
        opacity: 1.0;
    }
}

.headerBox {
width:100px;
    background: #ff0;
    padding: 10px;
    font-size: 15px;
    height: 100px;
    animation: fade 600ms infinite;
}
</style>
</head>
<body>
<div>&nbsp;</div>
</body>
</html>
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容