不要放弃治疗   发表于 2016-08-18 16:46:00

收藏 1894 2

CSS3-正方体

QQ截图20160818164542.png

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        *{padding:0;margin:0;}
        .div1{width: 500px;
            height: 500px;
            transform-style: preserve-3d ;
            perspective-origin:center center ;
            transform: rotateX(20deg) rotateY(30deg);
            position: relative;
            margin: 100px auto;
        }
        .div1 div{
            width: 300px;
            height: 300px;
            opacity:0.8;
            position: absolute;
            top:0;
        }
        .div1 div:nth-child(1){
            background-color: #089efd;
            transform: rotateY(90deg) translateZ(150px);
        }
        .div1 div:nth-child(2){
            background-color: #c1e2b3;
            transform: translateZ(150px);
        }
        .div1 div:nth-child(3){
            background-color: #0dc392;
            transform: rotateY(90deg) translateZ(150px);
        }
        .div1 div:nth-child(4){
            background-color: #a6e1ec;
            transform: translateZ(-150px);
        }
        .div1 div:nth-child(5){
           background-color:#CDEC95;
            transform: rotateX(90deg) translateZ(150px);
        }
        .div1 div:nth-child(6){
            background-color: #0dc392;
            transform: rotateX(-90deg) translateZ(150px);
        }
    </style>
</head>
<body>
<div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</div>
</body>
</html>


全部回复共2条
电梯直达
我要回复
返回顶部
邀请好友 App下载 意见反馈