CSS代碼:如何設置動畫背景圖像原始圖像中的CSS
body {
margin: 0;
padding: 0;
}
#slideshow {
position: relative;
overflow: hidden;
height: 100px;
}
#animate-area {
height: 100%;
width: 2538px;
position: absolute;
left: 0;
top: 0;
background-image: url('http://s30.postimg.org/qnju89rkx/banner.png');
-webkit-animation: animatedBackground 40s linear infinite;
}
/* Put your css in here */
@keyframes animatedBackground {
from { left: 0; }
to { left: -1269px; }
}
@-webkit-keyframes animatedBackground {
from { left: 0; }
to { left: -1269px; }
}
@-moz-keyframes animatedBackground {
from { left: 0; }
to { left: -1269px; }
}
的jsfiddle:http://jsfiddle.net/cz04c4nx/2/
現在動畫工作順利,但圖像大小不會顯示爲原始。 現在設置我的原始圖像爲動畫?..爲此,當我調整背景位置或寬度和高度,動畫不能正常工作,..
有人可以幫助我們,謝謝。
我不明白這個問題......圖片太小了嗎?它應該有多高? – Brian 2014-09-01 11:24:30
@BrianBennett:我想調整圖像的高度..並刪除黑色空間。 – sasi 2014-09-01 11:25:48
黑色空間是從圖像,你可以刪除它們通過Photoshop – Jack 2014-09-01 11:32:23