CSS生成div的闪烁特效
程序员文章站
2024-03-25 12:55:16
...
利用透明度实现div背景色的闪烁
<!DOCTYPE html>
<html lang="zh-CN">
<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 class="headerBox"> </div>
</body>
</html>