Background 如何在没有循环模式的情况下设置背景图像缩放效果的动画
你知道如何对视差背景进行变焦吗? 与此处相同的效果: 我使用这个代码,但它不工作,而且移动版本上的图像会改变高度Background 如何在没有循环模式的情况下设置背景图像缩放效果的动画,background,zooming,effect,Background,Zooming,Effect,你知道如何对视差背景进行变焦吗? 与此处相同的效果: 我使用这个代码,但它不工作,而且移动版本上的图像会改变高度 div { height: 100vh; background-size: 110% 110%; background-position: center center; animation: shrink 5s infinite alternate; } @keyframes shrink { 0% { background-size: 110%
div {
height: 100vh;
background-size: 110% 110%;
background-position: center center;
animation: shrink 5s infinite alternate;
}
@keyframes shrink {
0% {
background-size: 110% 110%;
}
100% {
background-size: 100% 100%;
}
}