我试图在css background-image中添加多个背景来创建一个小雪动画。我有6张图片:可以在css3背景图片中添加多少图片?
snow_big,snow_medium,snow_small,snow_man,树1和tree2
如果是只使用4动画图片我的动画作品完美,但是当我添加更多的图像。雪动画停止工作它的唯一动画从左到右但不是从上到下或者有时可能停止。这发生只在IE10但其他浏览器其工作我不知道我检查顺序,但它很好。 这里是使用CSS代码IM:
.xmas_theme_animation {
background-color:navy;
height:115px;
width:345px;
background-image: url('../images/snow_big.png')
,url('../images/snow_medium.png')
,url('../images/snow_small.png')
,url('../images/snow1_snowman.png')
,url('../images/tree1.png')
,url('../images/tree2.png');
background-repeat: repeat, repeat, repeat, no-repeat, no-repeat, no-repeat;
background-position: 0 0, 0 0, 0 0, 6% bottom, 20% bottom, 40% bottom;
animation: snowfall 10s infinite linear;
}
@keyframes snowfall {
from {background-position: 0 -340px, 0 -172.5px, 0 0px, 6% bottom, 20% bottom, 40% bottom; }
to {background-position: 0 345px, 661px 172.5px, 0 345px, 6% bottom, 20% bottom, 40% bottom;}
}
所以是有用于在CSS使用多个背景的任何限制?
谢谢
作为一种解决方法,您可以在伪元素之前和之后设置图像。 – vals