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

              
                <a class="border">線をアニメーション</a>
<div>
  <a class="button">ボタンをアニメーション</a>
</div>
              
            
!

CSS

              
                /* 線のアニメーション */
.border{
  color: blue;
  padding-bottom: 5px;
  position: relative; /*::afterにabsoluteをかけるので設定*/
}
.border::after{
  content: ''; /* コンテンツを追加 */
  width: 100%; /* 線の幅 */
  height: 1px; /* 線の高さ */
  background-color: blue; /* 線の色 */
  position: absolute; /* position: relative;からの線の絶対位置 */
  bottom: 0; /* 線の位置 */
  left: 0; /* 線の位置 */
  transform: scale(0,1); /* 線のx軸の長さを0 */
  transition: .5s; /* 要素の変形する時間*/
  transform-origin: left top; /* 要素の座標の原点を設定*/
}
.border:hover::after{
  transform: scale(1,1); /* 線のx軸の長さを1 */
}

/* ボタンのアニメーション */
div{
  padding-top: 40px;
}
.button{
  color: blue;
  width: 300px;
  height: 60px;
  line-height: 60px;
  border: solid 1px blue;
  display: inline-block;
  text-align: center;
  position: relative;
  z-index: 10;
  transition: .5s;
}
.button::before{
  content: ''; /* コンテンツを追加 */
  width: 100%; /* 線の幅 */
  height: 100%; /* 線の高さ */
  background-color: blue; /* 線の色 */
  position: absolute; /* position: relative;からの線の絶対位置 */
  top: 0; /* 線の位置 */
  left: 0; /* 線の位置 */
  z-index: -1;
  transform: scale(0,1); /* 線のx軸の長さを0 */
  transition: .5s; /* 要素の変形する時間*/
  transform-origin: left top; /* 要素の座標の原点を設定*/
}
.button:hover{
  color: #fff; /* マウスオーバーしたときのaタグの色 */
}
.button:hover::before{
  transform: scale(1,1);
}
              
            
!

JS

              
                
              
            
!
999px

Console