zoukankan      html  css  js  c++  java
  • 3D 立体 backface-visibility

    <!DOCTYPE html>
    <html>
        <head>
            <!--
                backface-visibility属性用来设置,是否显示元素的背面,默认是显示的
                backface-visibility:keyword;
                keyword有两个值,hidden和visible,默认是是visible
                所以是在每个元素里面设置的
                
            -->
            <meta charset="UTF-8">
            <title></title>
            <style type="text/css">
                *{
                    padding: 0;
                    margin: 0;
                    
                }
                #wrap{
                    position: absolute;
                    left: 50%;
                    top: 50%;
                    width: 400px;
                    height: 400px;
                    margin-left: -200px;
                    margin-top: -200px;
                    border: 1px solid;
                    perspective: 200px;
                    background: url(3.jpg) no-repeat;
                    background-size:100% 100%;
                    
                }
                #wrap > .box{
                    width: 100px;
                    height: 100px;
                    position: absolute;
                    left: 0;
                    top: 0;
                    right: 0;
                    bottom: 0;
                    margin: auto;
                    
                    transform-style: preserve-3d;
                    transition: 3s;
                    transform-origin: center center 50%; 
                }
                #wrap > .box > div{
                    position: absolute;
                    width: 100px;
                    height: 100px;
                    background: rgba(123,321,333,.3);
                    text-align: center;
                    font: 50px/100px "微软雅黑";
                    backface-visibility: hidden;
                    
                }
                #wrap > .box >div:nth-child(5){
                     
                     top: -100px;
                     transform-origin: bottom;
                     transform: rotateX(90deg);
                }
                #wrap > .box >div:nth-child(6){
                     
                     bottom: -100px;
                     transform-origin: top;
                     transform: rotateX(-90deg);
                }
                #wrap > .box >div:nth-child(3){
                    
                     left: -100px;
                     transform-origin: right;
                     transform: rotateY(-90deg);
                }
                #wrap > .box >div:nth-child(4){
                    
                     right: -100px;
                     transform-origin: left;
                     transform: rotateY(90deg);
                }
                
                #wrap > .box >div:nth-child(2){
                     
                     transform:   translateZ(-100px) rotateX(180deg);
                }
                #wrap > .box >div:nth-child(1){
                     
                     z-index: 1;
                }
                #wrap:hover .box{
                    transform: rotate3d(1,1,1,180deg);
                }
            </style>
        </head>
        <body>
            <div id="wrap">
                
                <div class="box">
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                    
                </div>
                
            </div>
        </body>
    </html>
  • 相关阅读:
    sql执行的顺序
    $(obj).index(this) 与 $(this).index()的区别
    java取得百分比
    取得input的特殊值
    清除select的边框和三角形
    在jsp页面中获取列表长度
    mysql mybatis 批量更新和新增
    oracle mybatis 批量更新和新增
    jstl if else 判断
    判断radio,select,checkbox是否选中的方法
  • 原文地址:https://www.cnblogs.com/caicaihong/p/9634064.html
Copyright © 2011-2022 走看看