day09

A

animation属性

关键字@keyframes用来定义一个动画(简单动画--从某种长宽高旋转倾斜等属性在一定时间内内转换到另一组对应属性)
然后用animation属性使用定义的动画,写法
animation:动画名 完成一轮的时间 循环属性

旋转
        div {
            width: 150px;
            height: 150px;
            background-color: #6149ff;

        }

        @keyframes bigToSmall {
            from {
                transform: rotate(0deg);
                /*width: 300px;*/
                /*height: 300px;*/
            }
            to {
                transform: rotate(360deg);
                /*width: 150px;*/
                /*height: 150px;*/
            }
        }

        div:hover {
            animation: bigToSmall 1s infinite;
        }
变色
@keyframes colorChange {
            from{
                background-color: #6ffdff;
            }
            to{
                background-color: #6149ff;
            }
        }

        @keyframes colorChange
          {
              0%   {background: #6ffdff;}
              33.3%  {background: #66B7FF;}
              66.6%  {background: #6149ff;}
              100% {background: #A658FF;}
          }

        .a-2{
            width: 150px;
            height: 150px;
            background-color: #6ffdff;
            animation: colorChange 3s infinite;
        }

B

animation属性

关键字@keyframes用来定义一个动画(简单动画--从某种长宽高旋转倾斜等属性在一定时间内内转换到另一组对应属性)
然后用animation属性使用定义的动画,写法
animation:动画名 完成一轮的时间 循环属性

旋转
        div {
            width: 150px;
            height: 150px;
            background-color: #6149ff;

        }

        @keyframes bigToSmall {
            from {
                transform: rotate(0deg);
                /*width: 300px;*/
                /*height: 300px;*/
            }
            to {
                transform: rotate(360deg);
                /*width: 150px;*/
                /*height: 150px;*/
            }
        }

        div:hover {
            animation: bigToSmall 1s infinite;
        }
变色
@keyframes colorChange {
            from{
                background-color: #6ffdff;
            }
            to{
                background-color: #6149ff;
            }
        }

        @keyframes colorChange
          {
              0%   {background: #6ffdff;}
              33.3%  {background: #66B7FF;}
              66.6%  {background: #6149ff;}
              100% {background: #A658FF;}
          }

        .a-2{
            width: 150px;
            height: 150px;
            background-color: #6ffdff;
            animation: colorChange 3s infinite;
        }

C

你可能感兴趣的:(day09)