发布网友 发布时间:2022-04-24 11:37
共2个回答
热心网友 时间:2023-10-11 10:04
<!DOCTYPE html>
<html>
<head>
<title> 这里是标题 </title>
<meta charset="utf-8">
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style>
*{margin:0;padding:0;}
html{
-webkit-animation: myfirst .1s ease 0s infinite alternate; /* Safari and Chrome */
animation: myfirst .1s ease 0s infinite alternate;
}
@-webkit-keyframes myfirst /* Safari 和 Chrome */
{
0% {background:rgb(255,0,0);}
5% {background:rgb(255,,0);}
10% {background:rgb(255,128,0);}
15% {background:rgb(255,192,0);}
20% {background:rgb(255,255,0);}
25% {background:rgb(192,255,0);}
30% {background:rgb(128,255,0);}
35% {background:rgb(,255,0);}
40% {background:rgb(0,255,0);}
45% {background:rgb(0,255,);}
50% {background:rgb(0,255,128);}
55% {background:rgb(0,255,192);}
60% {background:rgb(0,192,255);}
65% {background:rgb(0,128,255);}
70% {background:rgb(0,,255);}
75% {background:rgb(0,0,255);}
80% {background:rgb(,0,255);}
85% {background:rgb(128,0,255);}
90% {background:rgb(192,0,255);}
95% {background:rgb(255,0,255);}
100% {background:rgb(255,255,255);}
}
@-moz-keyframes myfirst /* Firefox */
{
0% {background:rgb(255,0,0);}
5% {background:rgb(255,,0);}
10% {background:rgb(255,128,0);}
15% {background:rgb(255,192,0);}
20% {background:rgb(255,255,0);}
25% {background:rgb(192,255,0);}
30% {background:rgb(128,255,0);}
35% {background:rgb(,255,0);}
40% {background:rgb(0,255,0);}
45% {background:rgb(0,255,);}
50% {background:rgb(0,255,128);}
55% {background:rgb(0,255,192);}
60% {background:rgb(0,192,255);}
65% {background:rgb(0,128,255);}
70% {background:rgb(0,,255);}
75% {background:rgb(0,0,255);}
80% {background:rgb(,0,255);}
85% {background:rgb(128,0,255);}
90% {background:rgb(192,0,255);}
95% {background:rgb(255,0,255);}
100% {background:rgb(255,255,255);}
}
@-o-keyframes myfirst /* Opera */
{
0% {background:rgb(255,0,0);}
5% {background:rgb(255,,0);}
10% {background:rgb(255,128,0);}
15% {background:rgb(255,192,0);}
20% {background:rgb(255,255,0);}
25% {background:rgb(192,255,0);}
30% {background:rgb(128,255,0);}
35% {background:rgb(,255,0);}
40% {background:rgb(0,255,0);}
45% {background:rgb(0,255,);}
50% {background:rgb(0,255,128);}
55% {background:rgb(0,255,192);}
60% {background:rgb(0,192,255);}
65% {background:rgb(0,128,255);}
70% {background:rgb(0,,255);}
75% {background:rgb(0,0,255);}
80% {background:rgb(,0,255);}
85% {background:rgb(128,0,255);}
90% {background:rgb(192,0,255);}
95% {background:rgb(255,0,255);}
100% {background:rgb(255,255,255);}
}
@keyframes myfirst
{
0% {background:rgb(255,0,0);}
5% {background:rgb(255,,0);}
10% {background:rgb(255,128,0);}
15% {background:rgb(255,192,0);}
20% {background:rgb(255,255,0);}
25% {background:rgb(192,255,0);}
30% {background:rgb(128,255,0);}
35% {background:rgb(,255,0);}
40% {background:rgb(0,255,0);}
45% {background:rgb(0,255,);}
50% {background:rgb(0,255,128);}
55% {background:rgb(0,255,192);}
60% {background:rgb(0,192,255);}
65% {background:rgb(0,128,255);}
70% {background:rgb(0,,255);}
75% {background:rgb(0,0,255);}
80% {background:rgb(,0,255);}
85% {background:rgb(128,0,255);}
90% {background:rgb(192,0,255);}
95% {background:rgb(255,0,255);}
100% {background:rgb(255,255,255);}
}
</style>
</head>
<body>
</body>
</html>
哎呀我去 ...... 已经被自己晃瞎 我的眼睛~~~
热心网友 时间:2023-10-11 10:05
用一个数组将背景图片放到里面,然后使用定时器调用函数改变body的背景图片,也就是循环数组中的元素来改变body的背景色