我想移動背景,但它似乎相當卡住。 我該如何移動它?爲什麼這不是動畫?
body {
background-color: black !important;
}
#background_div {
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
z-index: -1;
width: 100%;
height: 100%;
background-image: url("http://www.codeproject.com/KB/GDI-plus/ImageProcessing2/img.jpg");
background-position: center;
background-repeat: no-repeat;
animation-name: background_animation;
}
@keyframes background_animation {
0% {
transform: translate(0%, -100%) scale(4, 4);
}
25% {
transform: translate(100%, 0%) scale(5, 5);
}
50% {
transform: translate(50%, 100%) scale(6, 6);
}
100% {
transform: translate(0%, -100%) scale(4, 4);
}
}
<div id="background_div"></div>
https://jsfiddle.net/5he2otzL/