css3動畫從底部向上升


animation-fill-mode: forwards;/*當動畫完成時,動畫會停留在最后一幀。*/

升起來前

升起來后

 


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body,ol,ul,h1,h2,h3,h4,h5,h6,p,th,td,dl,dd,form,fieldset,legend,input,textarea,select{margin:0;padding:0}
body{font:14px"微軟雅黑","Arial Narrow",HELVETICA;background:#fff;-webkit-text-size-adjust:100%;}
li{list-style:none}
li{
float: left;
width: 25%;
height: 200px;
text-align: center;
}
img{
width: 200px;
height: 200px;
}
.head{
width: 100%;
height: 200px;
position:absolute;
animation:myfirst 2s;
-webkit-animation:myfirst 2s;
animation-fill-mode: forwards;/*當動畫完成時,動畫會停留在最后一幀。*/
overflow: hidden;
}
@-webkit-keyframes myfirst /* Safari and Chrome */
{
0% {height: 10px}
25% {height:50px;bottom:50%;}
50% {height:100px;bottom:50%;}
75% {height:160px; bottom:50%;}
100% {height:200px;bottom:50%;
}
}
</style>
</head>
<body>
<div class="head">
<ul>
<li>
<img src="image/hb.png">
</li>
<li>
<img src="image/jiang.png">
</li>
<li>
<img src="image/kf.png">
</li>
<li>
<img src="image/tubiao1.png">
</li>
</ul>
</div>
</body>
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM