• 纯CSS实现炫酷旋转小风车


    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title>旋转小风车</title>
            <style type="text/css">            
                .container{
                    position: absolute;
                    top:12%;
                    left: 0;
                    right: 0;
                    bottom: 0;
                    margin: auto;
                }
                
                .box_block{
                    position: relative;
                    width: 300px;
                    height: 300px;
                    margin: 0 auto;
                    animation: Positive_rotation 4s linear infinite;
                }
                
                .box_block:hover{
                    animation:contrarotation .8s linear infinite;/*linear 动画从头到尾的速度是相同的*/
                    /*infinite 动画无限次播放*/
                }
                
                /*反向旋转*/
                @keyframes contrarotation{
                    from{transform: rotate(0deg)}
                    to{transform: rotate(-360deg)}
                }
                
                /*正向旋转*/
                @keyframes Positive_rotation{
                    from{transform: rotate(0deg);}
                    to{transform: rotate(360deg);}
                }
                
                .div1{
                    width: 0;
                    height: 0;
                    border:75px solid #ffb02d;
                    border-left-color: transparent;/*隐藏*/
                    border-bottom-color: #3aa37a;
                    float: left;
                }
                
                .div2{
                    width: 0;
                    height: 0;
                    border: 75px solid #ffcd35;
                    border-top-color: transparent;
                    border-right-color: #ee7a65;
                    float: left;
                }
                
                .div3{
                    width: 0;
                    height: 0;
                    border:75px solid #a0bd77;
                    border-bottom-color: transparent;
                    border-right-color: #5687e7;
                    float: left;
                }
                
                .div4{
                    width: 0;
                    height: 0;
                    border:75px solid #5697fe;
                    border-right-color: transparent;
                    border-top-color: #ee7a65;
                    float: left;
                }
                
                .stick{
                    width: 14px;
                    height: 400px;
                    background: #666666;
                    z-index: -1;
                    left: 0;
                    top:86px;
                    bottom:0;
                    right: 0;
                    margin: auto;
                    position: absolute;
                }
            </style>
        </head>
        <body>
            <div class="container">
                <div class="box_block">
                    <div class="div1"></div>
                    <div class="div2"></div>    
                    <div class="div3"></div>
                    <div class="div4"></div>
                    <div class="remove_blocks" style="clear: both;"></div>
                </div>
                <div class="stick"></div>            
            </div>
        </body>
    </html>

    效果图:

  • 相关阅读:
    C++学习的小Tips
    搭建一个简单struts2框架的登陆
    Eclipse启动tomcat,http://localhost:8080/无法访问的解决方法
    JAVA解析XML的四种方法
    正则表达式学习笔记(附:Java版示例代码)
    Windows下几个常用的和进程有关的命令
    Java网络编程学习
    项目新增内存表优化软件速度
    Android三种消息提示
    数字手写识别——Java实现KNN算法
  • 原文地址:https://www.cnblogs.com/Best-Chen/p/9739545.html
Copyright © 2020-2023  润新知