0
HTML5:CSS animte背景图像问题
<div id="slideshow">
<div id='animate-area'>
</div>
</div>
的CSS:
body {
margin: 0;
padding: 0;
}
#slideshow {
position: relative;
overflow: hidden;
height: 145px;
}
#animate-area {
height: 100%;
width: 2538px;
position: absolute;
left: 0;
top: 0;
background-image: url('../img/banner.png');
animation: animatedBackground 40s 5s linear infinite;
-ms-animation: animatedBackground 40s linear infinite;
-moz-animation: animatedBackground 40s linear infinite;
-webkit-animation: animatedBackground 30s 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:
jsfiddle.net/cz04c4nx/1
使用这个形象,我需要显示像,http://jsfiddle.net/5pVr4/6/。我试过了,但对于我在本地主机上运行的url('../img/banner.png')
特定图像,无法获取。
你确定ü[R提供的相对路径。我觉得这是更多的路径问题。你可以提供你的项目文件夹结构 – Khaleel 2014-09-01 05:50:54
任何人都可以帮助我吗? – sasi 2014-09-01 05:57:49
在没有前缀的'animation'中,有一个'5s'的延迟,而前缀的没有。尝试删除。 – qtgye 2014-09-01 06:06:55