day09

作者: IcyRoc | 来源:发表于2017-11-17 00:57 被阅读0次

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

相关文章

  • 自律给我自由—Day009

    【叶子姑娘的自律100天挑战 Day09】 2019.01.23 Day09/100 【早起】第十二天早起。 【阅...

  • 三阶段day09-前后分离、ajax

    day09: 前后分离,ajax 前后分离 ajax

  • 四、canvas

    阻止IE6下的默认行为:image.png day09

  • 2018-12-16

    Day09 Object、日期与时间、System、StringBuilder、包装类 1.Object类 1.1...

  • 五、canvas(使用图片&设置背景)

    在canvas中插入图片(需要image对象) 在canvas中设置背景(需要image对象) 渐变 day09

  • Day09

    学习了,abstract. final. 内部类,包,继承,接口,interface 和implements 抽象...

  • day09

    数组 数组硕果仅存的优点就是效率. 新生成一个数组对象时,其中所有的引用被自动初始化为null,所以检查其中的引用...

  • Day09

    变量作用域 字符串 基本概念 字符串内存分析 字符串输出和输入字符串输出: puts(str); 字符串输入: g...

  • day09

    今天学了什么 1.字符串常用的方法 1.1 length 获取字符串的长度 1.2增加 concat() 方法用...

  • day09

    A今天学了什么 1.animation 动画 B今天学会了什么 1.animation 动画 C今天没掌握什么

网友评论

      本文标题:day09

      本文链接:https://www.haomeiwen.com/subject/qqkdvxtx.html