• 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

    }

     
  • 相关阅读:
    协程的嵌套
    利用excl的数据源表,手动选择品牌,根据品牌自动出现品牌的品牌类型、品牌型号、单价、质量等信息。
    uniapp实现薪资区间范围选择
    html2canvas + jspdf 实现html导出pdf并加水印
    jq实现薪资区间值选择
    C/C++中的函数指针的写法
    linux系统find命令的一些使用技巧
    RunAsDate改变软件获取系统时间工具
    电子政务及安全研究报告
    数据转换位串字节数组
  • 原文地址:https://www.cnblogs.com/cl94/p/10507336.html
Copyright © 2020-2023  润新知