zoukankan      html  css  js  c++  java
  • 前端学习笔记day07 动画效果--开门大吉

    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            .door {
                width: 460px;
                height: 300px;
                margin: 150px auto;
                position: relative;
                perspective: 1000px;
            }
            .door img {
                width: 460px;
            }
            .door-l,
            .door-r {
                width: 50%;
                height: 100%;
                /*background-color: pink;*/
                background: url("images/bg.png");
                position: absolute;
                top: 0;
                box-sizing: border-box;
                transition: all 0.6s;
    
            }
            .door-l {
                left: 0;
                border-right: 1px solid red;
                transform-origin: left center;
            }
            .door-r {
                right: 0;
                border-left: 1px solid red;
                transform-origin: right center;
            }
            .door-r::before,
            .door-l::before {
                content: "";
                display: block;
                width: 20px;
                height: 20px;
                border: 1px solid black;
                border-radius: 50%;
                position: absolute;
                top: 50%;
                transform: translateY(-50%);
            }
            .door-r::before {
                left: 10px;
                
            }
            .door-l::before {
                right: 10px;
            
            }
            .door:hover .door-l {
                transform: rotateY(-130deg);
            }
            .door:hover .door-r {
                transform: rotateY(130deg);
            }
        </style>
    </head>
    <body>
        <div class="door">
            <img src="images/6.jpg">
            <div class="door-l"></div>
            <div class="door-r"></div>
        </div>
    </body>
    </html>

    运行结果:

  • 相关阅读:
    java和.NET的比较
    联想笔记本不能无线上网
    js根据给定的日期计算当月有多少天
    jQuery中live()变更
    C#操作xml文件
    SQL server的with的用法(一)
    jquery拖拽实现UI设计组件
    自定义弹出框
    第一个超级简单Node.js实例
    windows 下使用redis
  • 原文地址:https://www.cnblogs.com/xuanxuanlove/p/10106793.html
Copyright © 2011-2022 走看看