cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="body">
<div class="box">
        <div class="front"><h1>我是大门</h1></div>
        <div class="back"><h1>我是后墙</h1></div>
        <div class="left"><h1>我是左侧</h1></div>
        <div class="right"><h1>我是右侧</h1></div>
        <div class="top"><h1>我是房顶</h1></div>
        <div class="bottom"><h1>我是地板</h1></div>

        <article class="front"><h1>我是大门</h1></article>
        <article class="back"><h1>我是后墙</h1></article>
        <article class="left"><h1>我是左侧</h1></article>
        <article class="right"><h1>我是右侧</h1></article>
        <article class="top"><h1>我是房顶</h1></article>
        <article class="bottom"><h1>我是地板</h1></article>
    </div>
</div>
            
          
!
            
              .body{
  -webkit-perspective: 1200px;
  -webkit-perspective-origin: center -300px;
  font-size: 14px;
}
h1{font-size:14px;}
.box{
  position: relative;
  width: 300px;
  height: 300px;
  margin: 200px auto;
  -webkit-transform-style: preserve-3d;
  -webkit-animation: animation 15s linear infinite;
  }
.box div, .box article{
  position: absolute;
  width: 300px;
  height: 300px;
  line-height: 300px;
  text-align: center;
  background: red;
  opacity: .8;
    border-radius: 50px;
    -webkit-transform-style: preserve-3d;
    -webkit-backface-visibility: visible;
    -webkit-transition: all .3s ease-in-out;
    }
  .box article{
    width: 100px;
    height: 100px;
    line-height: 100px;
    margin: auto;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    }
  .box:hover div.top{
    -webkit-transform: translateZ(-150px) rotateX(90deg) rotateY(45deg);
    }
  .box:hover article{
    top: -250px;
    }
  .box .front{
    background: red;
    -webkit-transform: translateZ(150px);
    }
  .box .top{
    -webkit-transform-origin: 100% 0%;
    background: #cc0000;
    -webkit-transform: translateZ(-150px) rotateX(90deg);
    }
  .box .back{
    background: gray;
    -webkit-transform: translateZ(-150px) rotateY(180deg);
    }
  .box .bottom{
    background: yellow;
    -webkit-transform: translateY(150px) rotateX(-90deg);
    }
  .box .left{
    background: blue;
    -webkit-transform: translateX(-150px) rotateY(-90deg);
    }
  .box .right{
    background: green;
    -webkit-transform: translateX(150px) rotateY(90deg);
    }

  .box article.front{
    background: red;
    -webkit-transform: translateZ(50px);
    }
  .box article.top{
    -webkit-transform-origin: 100% 0%;
    background: #cc0000;
    -webkit-transform: translateZ(-50px) rotateX(90deg);
    }
  .box article.back{
    background: gray;
    -webkit-transform: translateZ(-50px) rotateY(180deg);
    }
  .box article.bottom{
    background: yellow;
    -webkit-transform: translateY(50px) rotateX(-90deg);
    }
  .box article.left{
    background: blue;
    -webkit-transform: translateX(-50px) rotateY(-90deg);
    }
  .box article.right{
    background: green;
    -webkit-transform: translateX(50px) rotateY(90deg);
    }

  @-webkit-keyframes animation {
    0% {
    -webkit-transform: rotateY(0deg);
    }
  100% {
  -webkit-transform: rotateY(360deg);
  }
}
            
          
!
999px
Loading ..................

Console