day09

2017-09-06  本文已影响0人  向钱看丷向厚赚

A、今天学到了什么

1、动画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;
            }
        }

C、今天我没有掌握什么

animation 动画片制作
div {animation:myfirst 2s;}
//动画片:我的第一次2秒
div{animation:myfirst 2s infinite;}
//无限循环
上一篇下一篇

猜你喜欢

热点阅读