<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.flow-colorful {
max-width: 600px;
height: 150px;
background: linear-gradient(to right, red, orange, yellow, green, cyan, blue, purple);
animation: hue 6s linear infinite;
}
@keyframes hue {
from { filter: hue-rotate(0deg); }
to { filter: hue-rotate(360deg); }
}
</style>
</head>
<body>
<div class="flow-colorful">
</div>
</body>
</html>
转载于:https://www.cnblogs.com/xinyouhunran/p/11124667.html
本文介绍了一种使用HTML和CSS实现的彩色渐变背景动画效果,通过线性梯度和关键帧动画实现了从红色到紫色的平滑过渡,并且背景颜色会随时间周期性变化。

1万+

被折叠的 条评论
为什么被折叠?



