zoukankan      html  css  js  c++  java
  • 3d transform-style

    菜单 旋转 案例

    <!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            * {
                margin: 0;
                padding: 0;
            }
            
            ul {
                margin: 100px;
            }
            
            ul li {
                float: left;
                margin-left: 20px;
                 120px;
                height: 35px;
                list-style: none;
                perspective: 500px;
                line-height: 35px;
                text-align: center;
            }
            
            .box {
                position: relative;
                 100%;
                height: 100%;
                transform-style: preserve-3d;
                transition: all .4s;
            }
            
            .box:hover {
                transform: rotateX(90deg);
            }
            
            .front,
            .bottom {
                position: absolute;
                left: 0;
                top: 0;
                 100%;
                height: 100%;
            }
            
            .front {
                background-color: pink;
                z-index: 1;
                transform: translateZ(17.5px);
            }
            
            .bottom {
                background-color: purple;
                /* 先移动 再旋转 */
                transform: translateY(17.5px) rotateX(-90deg);
            }
        </style>
    </head>

    <body>
        <ul>
            <li>
                <div class="box">
                    <div class="front">前端程序员</div>
                    <div class="bottom">我在这里等你</div>
                </div>
            </li>

            <li>
                <div class="box">
                    <div class="front">前端程序员</div>
                    <div class="bottom">我在这里等你</div>
                </div>
            </li>

            <li>
                <div class="box">
                    <div class="front">前端程序员</div>
                    <div class="bottom">我在这里等你</div>
                </div>
            </li>

            <li>
                <div class="box">
                    <div class="front">前端程序员</div>
                    <div class="bottom">我在这里等你</div>
                </div>
            </li>

            <li>
                <div class="box">
                    <div class="front">前端程序员</div>
                    <div class="bottom">我在这里等你</div>
                </div>
            </li>
        </ul>
    </body>

    </html>
     
  • 相关阅读:
    native2ascii转码工具的使用
    文件查找工具Everything小工具的使用
    sql中decode()重要函数使用
    java中随机生成汉字
    java中Random(long seed)方法与rRandom()方法的使用产生随机数
    WEB项目web.xml文件中classpath: 跟classpath*:使用的区别
    170809、 把list集合中的数据按照一定数量分组
    170808、生成为CVS文件
    170807、intellij idea maven集成lombok实例
    170804、使用Joda-Time优雅的处理日期时间
  • 原文地址:https://www.cnblogs.com/ericblog1992/p/12938574.html
Copyright © 2011-2022 走看看