Cân nhắc hoạt ảnh CSS3 với tàu di chuyển trên div màu xanh dương. Vì lý do nào đó con tàu không di chuyển. HTML như sau:CSS3 Vị trí hoạt ảnh
<div id="wrapper">
<div id="sea">
<img src="ship.png" alt="ship" width="128" height="128"/>
</div>
</div>
Để làm cho hình ảnh động CSS3 tôi sử dụng như sau:
#wrapper { position:relative;top:50px;width:700px;height:320px;
margin:0 auto;background:white;border-radius:10px;}
#sea { position:relative;background:#2875DE;width:700px;height:170px;
border-radius:10px;top:190px; }
#sea img {
position:relative;left:480px;top:-20px;
animation:myship 10s;
-moz-animation:myship 10s; /* Firefox */
-webkit-animation:myship 10s; /* Safari and Chrome */
@keyframes myship {
from {left: 480px;}
to{left:20px;}
}
@-moz-keyframes myship {
from {left: 480px;}
to {left:20px;}
}
@-webkit-keyframes myship {
from {left: 480px;}
to{left:20px;}
}
}
hình ảnh Con tàu không di chuyển. Bất kỳ trợ giúp nào cũng được đánh giá rất cao.
Tôi biết đó là một bài cũ nhưng muốn chia sẻ này ... http://www.paulirish.com/2012/why- di chuyển-yếu tố-với-dịch-là-tốt hơn-posabs-topleft/ –