zoukankan      html  css  js  c++  java
  • 4:3D装换

     

     

     

     

     

     z轴单位一般不用 百分比  直接用精确的单位

     一  透视

    per spect ive

     

     

     perspective: 500px; [值是 视距 就是上图中的 d距离 ]

     
    body {
        perspective: 500px;//透视的值是: 视距px
    }
    
    div {
         200px;
        height: 200px;
        margin: 100px auto;
        background-color: pink;
        transform: translateZ(0);//设置z轴 
    }
    <div></div>

    2d里面只能按角度旋转

    3d里面可以按 X Y Z 或自定义轴旋转

     

       x轴旋转就像单杠一样   正值 左手法则

     
    y轴旋转就像钢管舞一样

    .

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>rotateY旋转</title>
        <style>
            body {
                perspective: 500px;
            }
            img {
                display: block;
                margin: 100px auto;
                transition: all 1s;
            }
            img:hover {
                transform: rotateY(180deg);
            }
        </style>
    </head>
    <body>
    <div><img src="img/ym.jpg" alt=""></div>
    
    </body>
    </html>

     



     

     

     

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>rotate</title>
        <style>
            body {
                perspective: 500px;
            }
            .father {
                position: relative;
                 300px;
                margin: 100px auto;
                /*开启子元素的三维立体空间*/
                transform-style: preserve-3d;
            }
            .father:hover {
                transform: rotateY(70deg);
                transition: all 2s;
            }
            .a {
                position: absolute;
                 300px;
                height: 300px;
                background: pink;
            }
            .b {
                position: absolute;
                 300px;
                height: 300px;
                background: blue;
                transform: rotateX(70deg);
            }
        </style>
    </head>
    <body>
    <div class="father">
        <div class="a">a</div>
        <div class="b">b</div>
    </div>
    
    </body>
    </html>
  • 相关阅读:
    CentOS7安装注意
    ES插件安装
    CentOS7命令
    ES安装手册
    五 、redis-cluster java api
    四 、Redis 集群的搭建
    三 redis 的 java api(jedis)
    C#验证码 使用GDI绘制验证码
    云时代架构阅读笔记二——Java性能优化(二)
    【转载】Asp .Net Web Api路由路径问题
  • 原文地址:https://www.cnblogs.com/fuyunlin/p/14364105.html
Copyright © 2011-2022 走看看