矩形應該向下移動,左邊然後右邊。但由於某種原因,他們只是「跳躍」。有人可以告訴我爲什麼嗎?CSS動畫不正確嗎?
<!DOCTYPE html>
<html>
<body>
<style>
.imgbox
{
position: relative;
float:left;
text-align:center;
width:120px;
height:130px;
border:1px solid gray;
margin:0px;
margin-bottom:8px;
padding:0px;
-webkit-animation-name:drop;
-webkit-animation-duration:2s;
-webkit-animation-timing-function:linear;
-webkit-animation-play-state:running;
-webkit-animation-fill-mode:forwards;
animation-name:drop;
animation-duration:2s;
animation-timing-function:linear;
animation-play-state:running;
animation-fill-mode:forwards;
}
@-webkit-keyframes drop
{
0% {top:10px;}
100% {top:100px;}
}
@keyframes drop
{
0% {top:10px;}
100% {top:100px;}
}
</style>
<div class="imgbox" id="stuff1" style="-webkit-animation-delay:1s; animation-delay:1s"></div>
<div class="imgbox" id="stuff2" style="-webkit-animation-delay:2s; animation-delay:2s"></div>
</body>
</html>
基本上我只想一個矩形接受動畫和旁邊做得一樣好,只是稍微延遲。這僅僅是一個例子,因此會出現很多矩形,爲什麼我不會製作單獨的div。
未經測試,但我看你的代碼,好像你需要設置'頂:10px的;''來作爲.imgbox'以及 –
這就是它!謝謝! – SMD01