css3过渡动画

过渡动画

transition:width 500ms(执行500毫秒) ease,height 500ms ease 500ms(延迟),background-color 500ms ease 1s
变成圆角
transition:border-radius 500ms ease;
所有的一起
transition:all 500ms

设置过度的运动方式

transition-timing-function

div:nth-child(1){
  transition:all 1s ease(匀速)|ease-in(开始快)|ease-out(越来越快 突然停止)|ease-in-out(开始和结束时候慢)
}

作业代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动画截图</title>
    <style type="text/css">
       .bian{
           width: 302px;
           height: 129px;
           margin: 0 auto;
           border: 1px solid black;
       }
        .zi{
            width: 69px;
            height: 17px;
            display: block;
            margin: 0 auto;
            margin-top: 104px;
        }
        .b1{
            float: left;
            width: 30px;
            height: 36px;
            background-color: red;
            margin-top: 32px;
            margin-left:16px;
            border-radius: 10px;/*变成椭圆*/
            animation: dong 1s ease 1ms infinite;
        }
        .b2{
            float: left;
            width: 30px;
            height: 36px;
            background-color: green;
            margin-top: 32px;
            margin-left:29px;
            border-radius: 10px;
            animation: dong 1s ease 100ms infinite;
        }
        .b3{
            float: left;
            width: 30px;
            height: 36px;
            background-color: #ffc1cd;
            margin-top: 32px;
            margin-left:29px;
            border-radius: 10px;
            animation: dong 1s ease 200ms infinite;
        }
        .b4{
            float: left;
            width: 30px;
            height: 36px;
            background-color: greenyellow;
            margin-top: 32px;
            margin-left:29px;
            border-radius: 10px;
            animation: dong 1s ease 300ms infinite;
        }
        .b5{
            float: left;
            width: 30px;
            height: 36px;
            background-color: cyan;
            margin-top: 32px;
            margin-left:29px;
            border-radius: 10px;
            animation: dong 1s ease 400ms infinite;
        }
        @keyframes dong {

            from{
                height: 30px;/*原本 后来 进度 刚开始的什么样*/
            }
            to{
                transform: scale(1,2);/*缩放 前边原本宽的倍数 后边原本高的倍数 */
            }
        }
    </style>
</head>
<body>
    <div class="bian">
        <div class="b1"></div>
        <div class="b2"></div>
        <div class="b3"></div>
        <div class="b4"></div>
        <div class="b5"></div>
        <span class="zi">loading...</span>
    </div>
</body>
</html>

作业

动画.png
动画.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • W3C标准中对css3的transition这是样描述的:“css的transition允许css的属性值在一定的...
    青春前行阅读 1,524评论 0 5
  • 选择qi:是表达式 标签选择器 类选择器 属性选择器 继承属性: color,font,text-align,li...
    love2013阅读 2,406评论 0 11
  • 七律/锦带花 作者:心博、图片:网络 堆堆簇簇丛丛茂,密密麻麻郁郁浓。 佼佼娇娇形俏俏,悠悠漫漫影蒙蒙。 莺莺燕燕...
    心博1阅读 972评论 0 0
  • 北宋梅尧臣的《宛陵集》第十五卷依韵和杜相公谢蔡君谟寄茶诗,其中有语云:“小石冷泉留早味,紫泥新品泛春华”此句不仅说...
    石破天聊紫砂阅读 1,323评论 0 0
  • 最近这段时间一直在和家人谈论孩子的教育问题,孩子是我们的产品,是富有生命力的产品,孩子的教育是一个大的工程,没...
    明珠随笔阅读 712评论 0 1

友情链接更多精彩内容