• css3 3d立方体练习


    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <style type="text/css">
    .box{
    200px;
    height: 200px;
    position: relative;
    margin: 100px auto;
    transform-style: preserve-3d;
    transform:rotateX(45deg) rotateY(45deg);
    font-size: 50px;
    color: white;
    text-align: center;
    line-height: 200px;
    }
    .box div{
    200px;
    height: 200px;
    position: absolute;
    background-color: red;
    /*opacity设置元素的透明度 默认是1*/
    opacity: .3;
    }
    .box>div:first-child{
    transform: translateZ(100px);
    background-color: black;
    }
    .box>div:nth-child(2){
    background-color: yellow;
    transform: rotateY(-90deg) translateZ(100px);
    }
    .box>div:nth-child(3){
    background-color: purple;
    transform: rotateX(90deg) translateZ(100px);
    }
    .box>div:nth-child(4){
    background-color: black;
    transform: rotateX(-90deg) translateZ(100px);
    }
    .box>div:nth-child(5){
    background-color: greenyellow;
    transform: rotateY(-90deg) translateZ(-100px);
    }
    .box>div:last-child{
    transform: translateZ(-100px);
    }
    </style>
    </head>
    <body>
    <div class="box">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
    </div>
    </body>
    </html>

  • 相关阅读:
    关系运算符重载
    一元运算符重载
    二元运算符重载
    重载函数和重载运算符
    Linux之文件通信
    Linux进程通信之mmap
    Linux之创建多个子进程
    内联函数
    静态成员
    this指针
  • 原文地址:https://www.cnblogs.com/adialike/p/6388937.html
Copyright © 2020-2023  润新知