css文字从上往下飘出

1,294 阅读1分钟
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
<style>
     div
       {
           width:100px;
           height:0px;
      
           position:absolute;
           animation:myfirst 3s;
           -webkit-animation:myfirst 3s;
           myfirst是动画名称 3s是整个动画的时长
           animation-fill-mode: forwards;
           动画完成时,动画会停留在最后一帧
       }
       @-webkit-keyframes myfirst /* Safari and Chrome */
       {
           0%   { left:500px;height:0px; bottom:50px;color:#fff;}
           100% { left:500px; height:80px;bottom:50px;color:red;}
       }
</style>
</head>

<body>
<div>11111</div>


</body>
</html>