背景图像在延迟后放大,这会自动放大到图像的中心。想要缩放到右下角或图像的特定部分。
#backgroundImage {
background: url("images/imagepath.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100vh;
width: 100%;
background-attachment: scroll;
-webkit-animation: zoom 3s forwards;
-webkit-animation-delay: 2s;
animation: zoom 3s forwards;
animation-delay: 2s;
z-index: 10;}
/* Chrome,Safari,Opera */
@-webkit-keyframes zoom {
from {
-webkit-transform: scale(1,1);
}
to {
-webkit-transform: scale(2,2);
}
}
/* Standard syntax */
@keyframes zoom {
from {
transform: scale(1,1);
}
to {
transform: scale(2,2);
}
}