我想做一个网站,当你打开它,背景消失成不同的颜色。
示例:
/* Chrome, Safari, Opera */
@-webkit-keyframes {
from {
background: white;
}
to {
background: #F7F2E0;
}
}
/* Firefox */
@-moz-keyframes {
from {
background: white;
}
to {
background: #F7F2E0;
}
}
@keyframes {
from {
background: white;
}
to {
background: #F7F2E0;
}
}但是当我运行脚本时,什么都不会发生。
发布于 2014-05-04 15:31:15
发布于 2014-05-04 15:32:30
你必须给你的关键帧起一个名字,然后把它应用到身体上。参见此示例。用于动画和浏览器支持请看这里。
@keyframes fadeBackgroud{
from {
background:white;
} to {
background:#F7F2E0;
}
}
body {
animation:fadeBackgroud 5s infinite;
}https://stackoverflow.com/questions/23457984
复制相似问题