点击或者hover字体逐渐由透明变白色
css样式:
a:hover p{
animation: change 2s linear 0s infinite;
}
@keyframes change {
0% {
color: rgba(255,255,255,0.1)
}
30%{
color:rgba(255,255,255,0.3)
}
50% {
color: rgba(255,255,255,0.5)
}
80% {
color: rgba(255,255,255,0.8)
}
100% {color: rgba(255,255,255,1);}
}
相应的,字体变成其他颜色也是同样的道理!
修改一下 发现了个bug hover在上面会不停地闪动
修改为:
animation: change 2s ease-in-out 0s 1 alternate forwards