zoukankan      html  css  js  c++  java
  • css动画效果之transition(动画效果属性)

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
    </head>
    <!-- animation:动画效果属性
    
        “关键帧”(@keyframes),它的样式规则是由多个百分比构成的,比如“0%”到“100%”之间,加上不同的属性,从而让元素达到一种不断变化的效果。语法规则如下:
    
        @keyframes 动画名称{
            0%{元素状态}
            ...
            100%{元素状态}
        }
    
        animation属性:
        animation-name:@keyframes动画的名称
        animation-duration:动画完成一个周期所花费的时间,默认是0
        animation-timing-function:动画的速度曲线(缓动效果)。默认是“ease”
        animation-delay:动画开始的延迟时间,默认是0
        animation-iteration-count:动画被播放的次数。默认是1
        animation-direction:动画是否在下一周期逆向的播放。默认是“normal”
        animation-play-state:动画是否存在运行或暂停,默认是“running”
        animation-fill-mode:对象动画时间之外的状态
     -->
        <style>
            .box{
                height: 100px;
                width: 100px;
                margin:50px auto;
                background-color: #f00
            }
            .box:hover{
                /* 绑定动画名称,设置完成周期1s,设置速度曲线加速,设置延迟时间0,设置播放次数无限,循环逆向播放*/
                animation: hover 1s ease-in 0s infinite alternate;
            }
            @keyframes hover{
                0%{width: 100px;height: 100px;border-radius: 50%;}
                50%{width: 200px;height: 200px;border-radius: 50%;}
                100%{width: 100px;height: 100px;border-radius: 50%;}
            }
        </style>
    
    }
    <style>
    
    
    </style>
    <body>
        <div class="box"></div>
    </body>
    </html>

    Document

    }

     
  • 相关阅读:
    CF982C Cut 'em all! DFS 树 * 二十一
    CF985C Liebig's Barrels 贪心 第二十
    CF985B Switches and Lamps 思维 第十九
    CF 990D Graph And Its Complement 第十八 构造、思维
    CF991D Bishwock 第十七 贪心
    CF990B Micro-World 贪心 第十六
    CF991C Candies 二分 第十五
    CF996B World Cup 思维 第十四 *
    CF995B Suit and Tie 贪心 第十三
    C++继承的构造与析构!
  • 原文地址:https://www.cnblogs.com/cl94/p/10507336.html
Copyright © 2011-2022 走看看