Animations动画和Keyframes关键帧

简介: Title body { display: flex; /* 使用Flex布局 */ justify-content: center; /* 水平居中 */ } .
<!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>

  

相关文章
|
9月前
SVG SMIL 动画(基本动画 、变换动画)
SVG SMIL 动画(基本动画 、变换动画)
31 0
|
11月前
|
存储 文件存储 云计算
不瞒了,我们和追光动画有一个《杨戬》!
不瞒了,我们和追光动画有一个《杨戬》!
128 0
|
前端开发
动画
动画
97 0
|
容器 JavaScript Web App开发
如何不用 transition 和 animation 也能做网页动画
效果预览 在线演示 按下右侧的“点击预览”按钮可以在当前页面预览,点击链接可以全屏预览。 https://codepen.io/comehope/pen/BxbQJj 可交互视频教程 此视频是可以交互的,你可以随时暂停视频,编辑视频中的代码。
1101 0
|
XML Android开发 数据格式
|
前端开发 JavaScript