CSS实现呼吸灯动效
2019-11-13 本文已影响0人
西瓜鱼仔
实现原理:改变图片的透明度
代码:
<div class="breath"></div>
.breath {
width: 8%;
height: 77%;
position: absolute;
right: 19px;
top: 17px;
background: url("../../assets/image/drugRight/BreathingLampL.png") no-repeat;
background-size: 100% 100%;
animation: breathLamp 2s alternate infinite;
}
@keyframes breathLamp{
0%{
opacity:.2;
}
100%{
opacity:1;
}
原文地址:https://blog.csdn.net/localhost_1314/article/details/96483918