css3动画如何定位
css3动画怎么定位
<style>
.pr{ overflow:hidden; position:relative; top:0; left:0; height:340px;}
.content{ overflow:hidden;width:72%; background-color:#ffe200; margin:0 auto; position:absolute; left:14%; top:0; z-index:5;}
.jiage{overflow:hidden;width:72%; background-color:#333335; margin:0 auto; position:absolute; left:14%;top:-170px; z-index:1; -webkit-animation:myFirst 3s linear; }
@-webkit-keyframes myFirst
{
from{ top:-170px;}
to{ top:140px;}
}
</style>
<div class="pr">
<div class="content">
<div class="contentL">
<img src="images/shuzi.png"></div>
<div class="contentR">
<p>性能与价格的黄金比例,品牌首次错卖,用户首次不错买!</p>
<P>媲美国际一线品牌的品质和性能,绝杀国产友商之价格!</P>
<P>读写双500+,AS SSD可达1250,四核八通道主控,稳定可靠的3000次以上P/E,150TBW写入量保护,5年无忧保固</P>
</div>
</div>
<div class="jiage">
<div class="first">
<span>128G</span>
<span><b>¥</b>299</span>
<span>原价¥459</span></div>
<div class="first">
<span>256G</span>
<span><b>¥</b>499</span>
<span>原价¥799</span></div>
<div class="first last">
<span>512G</span>
<span><b>¥</b>999</span>
<span>原价¥1499</span></div>
</div>
</div>
价格那个div从-170px的位置往下移,到140px的位置后立刻返回到-170px的位置,怎么才能让他定在140px的位置
------解决思路----------------------
.jiage{overflow:hidden;width:72%; background-color:#333335; margin:0 auto; position:absolute; left:14%;top:140px; z-index:1; -webkit-animation:myFirst 3s linear; }
------解决思路----------------------
设置.jiage中的top为你要停留的值。。。
<style>
.pr{ overflow:hidden; position:relative; top:0; left:0; height:340px;}
.content{ overflow:hidden;width:72%; background-color:#ffe200; margin:0 auto; position:absolute; left:14%; top:0; z-index:5;}
.jiage{overflow:hidden;width:72%; background-color:#333335; margin:0 auto; position:absolute; left:14%;top:-170px; z-index:1; -webkit-animation:myFirst 3s linear; }
@-webkit-keyframes myFirst
{
from{ top:-170px;}
to{ top:140px;}
}
</style>
<div class="pr">
<div class="content">
<div class="contentL">
<img src="images/shuzi.png"></div>
<div class="contentR">
<p>性能与价格的黄金比例,品牌首次错卖,用户首次不错买!</p>
<P>媲美国际一线品牌的品质和性能,绝杀国产友商之价格!</P>
<P>读写双500+,AS SSD可达1250,四核八通道主控,稳定可靠的3000次以上P/E,150TBW写入量保护,5年无忧保固</P>
</div>
</div>
<div class="jiage">
<div class="first">
<span>128G</span>
<span><b>¥</b>299</span>
<span>原价¥459</span></div>
<div class="first">
<span>256G</span>
<span><b>¥</b>499</span>
<span>原价¥799</span></div>
<div class="first last">
<span>512G</span>
<span><b>¥</b>999</span>
<span>原价¥1499</span></div>
</div>
</div>
价格那个div从-170px的位置往下移,到140px的位置后立刻返回到-170px的位置,怎么才能让他定在140px的位置
------解决思路----------------------
.jiage{overflow:hidden;width:72%; background-color:#333335; margin:0 auto; position:absolute; left:14%;top:140px; z-index:1; -webkit-animation:myFirst 3s linear; }
------解决思路----------------------