知识点九

动画animation
//定义:@keyframes (//关键帧)
1、@keyframes myfirst
{
form{background:red;}
to{background:yellow;}
}

例子:

//HTML
<div class="box"></div>
~~

//CSS

 .box{
            width: 100px;
            height: 100px;
            background-color: orange;
  @keyframes aa {
            from{
                width: 100px;
                height: 100px;
                background-color: orange;
            }
            to{
                width: 200px;
                height: 200px;
                background-color: yellow;
            }
        }

2、@keyframes myfirst
{
0%{background:red;}
25%{background:yellow;}
50%{background:blue;}
100%{background:green;}
}

例子:

//HTML
<div class="box"></div>
//CSS
   /*.box:hover{*/
            /*animation: bb 15s ;*/
        /*}*/

 @keyframes  bb {
            0%{
                width: 100px;
                height: 100px;
                background-color: orange;
            }
            20%{
                width: 400px;
                height: 100px;
                background-color: yellow;
            }
            40%{
                width: 100px;
                height: 100px;
                background-color: yellow;
            }
            60%{
                width: 100px;
                height: 500px;
                background-color: aquamarine;
            }
            80%{
                width: 100px;
                height: 300px;
                background-color: orange;
            }
            100%{
                width: 100px;
                height: 500px;
                background-color: orange;
            }
        }
animation 动画片制作
div {animation:myfirst 2s;}
//动画片:我的第一次2秒
div{animation:myfirst 2s infinite;}
//无限循环

B、今天掌握了什么

动画animation
//定义:@keyframes (//关键帧)
1、@keyframes myfirst
{
form{background:red;}
to{background:yellow;}
}

例子:

//HTML
<div class="box"></div>
~~

//CSS

 .box{
            width: 100px;
            height: 100px;
            background-color: orange;
  @keyframes aa {
            from{
                width: 100px;
                height: 100px;
                background-color: orange;
            }
            to{
                width: 200px;
                height: 200px;
                background-color: yellow;
            }
        }

2、@keyframes myfirst
{
0%{background:red;}
25%{background:yellow;}
50%{background:blue;}
100%{background:green;}
}

例子:

//HTML
<div class="box"></div>
//CSS
   /*.box:hover{*/
            /*animation: bb 15s ;*/
        /*}*/

 @keyframes  bb {
            0%{
                width: 100px;
                height: 100px;
                background-color: orange;
            }
            20%{
                width: 400px;
                height: 100px;
                background-color: yellow;
            }
            40%{
                width: 100px;
                height: 100px;
                background-color: yellow;
            }
            60%{
                width: 100px;
                height: 500px;
                background-color: aquamarine;
            }
            80%{
                width: 100px;
                height: 300px;
                background-color: orange;
            }
            100%{
                width: 100px;
                height: 500px;
                background-color: orange;
            }
        }
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • A、今天学到了什么 1、动画animation//定义:@keyframes (//关键帧) 例子 //CSS 例...
    向钱看丷向厚赚阅读 231评论 0 0
  • A我今天学了什么 动画animation//定义:@keyframes (//关键帧) animation 动画片...
    孔子曰_f425阅读 158评论 0 0
  • 在iOS中随处都可以看到绚丽的动画效果,实现这些动画的过程并不复杂,今天将带大家一窥iOS动画全貌。在这里你可以看...
    F麦子阅读 5,148评论 5 13
  • 在iOS中随处都可以看到绚丽的动画效果,实现这些动画的过程并不复杂,今天将带大家一窥ios动画全貌。在这里你可以看...
    每天刷两次牙阅读 8,580评论 6 30
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,714评论 25 709