作者:荆州房产网 | 来源:互联网 | 2022-12-06 21:39
我已经对h1元素实现了悬停效果(请参阅下面的代码和笔),但是在返回到原始状态之前,效果在鼠标移出时会出现奇怪的行为并且会出现闪烁.
任何想法如何使其转换回原始颜色,就像它在悬停时淡入一样平滑?
提前致谢.
https://codepen.io/lobodemon/pen/YOXKNJ
h1 {
transition: 0.5s;
}
h1:hover {
background: linear-gradient(-45deg, #EE7752, #E73C7E, #23A6D5, #23D5AB);
background-size: 400% 400%;
color:transparent;
-webkit-background-clip: text;
background-clip: text;
-webkit-animation: Gradient 15s ease infinite;
-moz-animation: Gradient 15s ease infinite;
animation: Gradient 15s ease infinite;
}
@-webkit-keyframes Gradient {
0%, 100% {
background-position: 0 50%
}
50% {
background-position: 100% 50%
}
}
@-moz-keyframes Gradient {
0%, 100% {
background-position: 0 50%
}
50% {
background-position: 100% 50%
}
}
@keyframes Gradient {
0%, 100% {
background-position: 0 50%
}
50% {
background-position: 100% 50%
}
}
The Title