css实现div背景色闪烁效果

来自:互联网
时间:2020-10-27
阅读:

我们先来看下效果图:

<a href=https://www.freexyz.cn/dev/css/ target=_blank class=infotextkey>CSS</a>实现div背景色闪烁效果

代码实现:

<!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>
返回顶部
顶部