首页 > 其他 > 详细

Animations动画和Keyframes关键帧

时间:2017-09-27 17:07:16      阅读:248      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    body {
        display: flex;              /* 使用Flex布局 */
        justify-content: center;    /* 水平居中 */
    }
    .ball {
        width: 100px;
        height: 100px;
        border-radius: 50%;         /* 把正方形变成圆形*/
        background-color: #FF5722;  /* 设置颜色为橙色*/
        animation: bounce 0.5s cubic-bezier(.5,0.05,1,.5);
        animation-direction: alternate;  //alternate(2,4,6)反向动画
        animation-iteration-count: infinite;
    }
    @keyframes bounce {
        from { transform: translate3d(0, 0, 0);     }
        to   { transform: translate3d(0, 200px, 0) rotateX(45deg); }
    }
</style>
<body>
<div class="ball"></div>
<script>
</script>
</body>
</html>

  

Animations动画和Keyframes关键帧

原文:http://www.cnblogs.com/jiebba/p/7602668.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!