• 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>
     
  • 相关阅读:
    vsCode_1.27.2
    前端图片压缩(纯js)
    chrome浏览器表单自动填充默认样式(背景变黄)-autofill
    前端Table数据导出Excel使用HSSFWorkbook(Java)
    linux下安装python3.6
    linux 下启动tomca慢问题
    linux下nginx配置ssl证书(https)
    spring+mybatis多数据源
    css3实现小箭头,各种图形
    Windows 环境搭建Redis集群(win 64位)
  • 原文地址:https://www.cnblogs.com/ericblog1992/p/12938574.html
Copyright © 2020-2023  润新知