动画

过渡动画transition属性简介

transition是网页上的变化的逐渐过渡效果

例:transition: property duration timing-function delay;

  • border-radius:圆角
  • transition:产生动画
  • transition:all ... ease所有一起变
  • liner:匀速
  • ease-in:开始是慢速
  • ease-out:结束时慢速
  • scale:缩放
  • perspective:透视距离
  • transform:交换 skew:斜切

 <!DOCTYPE html>
 <html lang="en">
 <head>
<meta charset="UTF-8">
<title>loading</title>
<style type="text/css">
    .box{
        width:300px;
        height:125px;
        border:1px solid #000;
        margin:200px auto 0;
    }
    .box p{
        text-align: center;
        padding-top: 89px;
        float: top;
    }
    .box1{
        width:30px;
        height:70px;
        margin:15px;
        background-color:rgb(255,0,0);
        border-radius:10px;
        animation: loading 0.5s ease 100ms infinite alternate;
        float: left;
    }
    .box2{
        width:30px;
        height:70px;
        margin:15px;
        background-color: rgb(0,219,0);
        border-radius:10px;
        animation: loading 0.5s ease 200ms infinite alternate;
        float: left;
    }
    .box3{
        width:30px;
        height:70px;
        margin:15px;
        background-color: rgb(255,193,203);
        border-radius:10px;
        animation: loading 0.5s ease 300ms infinite alternate;
        float: left;
    }
    .box4{
        width:30px;
        height:70px;
        margin:15px;
        background-color: rgb(173,255,46);
        border-radius:10px;
        animation: loading 0.5s ease 400ms infinite alternate;
        float: left;
    }
    .box5{
        width:30px;
        height:70px;
        margin:15px;
        background-color: rgb(0,255,255);
        border-radius:10px;
        animation: loading 0.5s ease 500ms infinite alternate;
        float: left;
    }
    @keyframes loading{
        from{
            transform: scaleY(1);
        }
        to{
            transform: scaleY(0.5);
        }
    }
</style>
</head>
<body>
<div class="box">
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
    <div class="box4"></div>
    <div class="box5"></div>
    <p>loading....</p>
</div>
</body>
</html>
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 看了很多视频、文章,最后却通通忘记了,别人的知识依旧是别人的,自己却什么都没获得。此系列文章旨在加深自己的印象,因...
    DCbryant阅读 1,978评论 0 4
  • 框架集 框架集和内联框架的作用类似,都是用于在一个页面中引入其他的外部的页面框架集可以同时引入多个页面,而内联框架...
    幸而0407阅读 241评论 0 0
  • 圆角 设置某一个角的圆角,比如设置左上角的圆角:border-top-left-radius:30px 60px;...
    时光清浅_许你心安_阅读 231评论 0 0
  • 框架集 框架集和内联框架的作用类似,都是用于在一个页面中引入其他的外部的页面框架集可以同时引入多个页面,而内联框架...
    咻咻咻滴赵大妞阅读 558评论 0 0
  • 一月,滴滴人力实习,奔波在北京和长春之间。 二月,如上,宋胖子求婚成功 三月,新年,独自来到上海,湖南,见了昕昕。...
    翅膀没有自由阅读 90评论 0 0

友情链接更多精彩内容