Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- <div>
  <p>指定なし</p>
  <div class="bg">
    <div class="itemBox"></div>
  </div>
</div> -->
<h2>↓↓ 図形にマウスカーソルを合わせてみよう!</h2>
<div>
  <p>Z軸方向へ移動</p>
  <p class="text">transform: perspective(500px) translateZ(100px)</p>
  <div class="translateZ itemBox"></div>
</div>
<div>
  <p>X軸、Y軸、Z軸方向へ移動</p>
  <p class="text">transform: perspective(500px) translate3d(20px, 10px, 30px)</p>
  <div class="translate3d itemBox"></div>
</div>

<div>
  <p>Y軸を中心に回転</p>
  <p class="text">transform-origin: left center<br>transform: perspective(500px) rotateY(45deg)</p>
  <div class="rotateY itemBox"></div>
</div>

<div>
  <p>X軸を中心に回転</p>
  <p class="text">transform-origin: center bottom<br>transform: perspective(500px) rotateX(90deg)</p>
  <div class="rotateX itemBox"></div>
</div>

<div>
  <p>右上を基点にX軸、Z軸方向に回転</p>
  <p class="text">transform-origin: right top<br>transform: perspective(500px) rotateX(45deg) rotateZ(45deg)</p>
  <div class="rotateZ itemBox"></div>
</div>

<div>
  <p>X軸の真ん中を基点にぐるっと回転</p>
  <p class="text">transform: rotate3d(10, 10, 20, 180deg)</p>
  <div class="rotate3d itemBox"></div>
</div>

<div>
  <p>X軸方向に回転しながら拡大</p>
  <p class="text">transform: perspective(500px) scale3d(1.2, 1.2, 5) rotateX(45deg)</p>
  <div class="scale3d itemBox"></div>
</div>

<div>
  <p>Y軸方向に回転しながら拡大</p>
  <p class="text">transform: perspective(500px) scale3d(1.2, 1.2, 5) rotateY(45deg)</p>
  <div class="scale3d_2 itemBox"></div>
</div>

              
            
!

CSS

              
                /* base */
.bg {
  width: 100px;
  background-color: #999;
  margin: 30px auto;
  padding: 20px 50px;
}
p {
  font-weight: bold;
  text-align: center;
}
.text {
  font-size: 0.75rem;
}
h2 {
  text-align: center;
}
/* 親要素にtransitionを指定 */
.itemBox {
  width: 100px;
  height: 100px;
  text-align: center;
  background-color: blue;
  margin: 30px auto;
  -webkit-transition: all .5s ease;
  transition: all .5s ease;
}

.translateZ:hover {
  -webkit-transform: perspective(500px) translateZ(100px);
          transform: perspective(500px) translateZ(100px);
}
.translate3d:hover {
  -webkit-transform: perspective(500px) translate3d(20px, 10px, 30px);
          transform: perspective(500px) translate3d(20px, 10px, 30px);
}
.rotateY {
  -webkit-transform-origin: left center;
          transform-origin: left center;
}
.rotateY:hover {
  -webkit-transform: perspective(500px) rotateY(90deg);
          transform: perspective(500px) rotateY(90deg);
}
.rotateX {
  -webkit-transform-origin: center bottom;
          transform-origin: center bottom;
}
.rotateX:hover {
  -webkit-transform: perspective(500px) rotateX(90deg);
          transform: perspective(500px) rotateX(90deg);
}
.rotateZ {
  -webkit-transform-origin: right top;
          transform-origin: right top;
}
.rotateZ:hover {
  -webkit-transform: perspective(500px) rotateX(45deg) rotateZ(45deg);
          transform: perspective(500px) rotateX(45deg) rotateZ(45deg);
}
.rotate3d:hover {
  -webkit-transform: rotate3d(10, 10, 20, 180deg);
          transform: rotate3d(10, 10, 20, 180deg);
}
.scale3d:hover {
  -webkit-transform: perspective(500px) scale3d(1.2, 1.2, 5) rotateX(45deg);
          transform: perspective(500px) scale3d(1.2, 1.2, 5) rotateX(45deg);
}
.scale3d_2:hover {
  -webkit-transform: perspective(500px) scale3d(1.2, 1.2, 5) rotateY(45deg);
          transform: perspective(500px) scale3d(1.2, 1.2, 5) rotateY(45deg);
}

              
            
!

JS

              
                
              
            
!
999px

Console