Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                <h1>CSSだけでできるおしゃれなホバーエフェクト</h1>
<ul>
  <li>
    <h2>ボタンが浮かび上がるホバー</h2>
    <a href="#" class="c-btn hover1">ホバーしてね</a>
  </li>
  <li>
    <h2>アウトラインのホバー</h2>
    <a href="#" class="c-btn hover2">ホバーしてね</a>
  </li>
  <li>
    <h2>矢印の周りに丸のアウトラインが出るホバー</h2>
    <a href="#" class="c-btn hover3">ホバーしてね <i class="fa fa-caret-right" aria-hidden="true"></i></a>
  </li>
  <li>
    <h2>文字間を広くするホバー</h2>
    <a href="#" class="c-btn hover4">ホバーしてね</a>
  </li>
  <li>
    <h2>ふわっとボタンが手に吸い付くホバー</h2>
    <a href="#" class="c-btn hover5">ホバーしてね</a>
  </li>
</ul>
              
            
!

CSS

              
                body{
  background-color: #fcf6d5;
}
h1{
  margin: 60px auto 40px;
  text-align: center;
  font-family: 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', Meiryo, メイリオ, Osaka, 'MS PGothic', arial, helvetica, sans-serif;
  background-image: linear-gradient(to top right, #fa709a 0%, #fee140 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 30px;
}
li{
  float: left;
  list-style: none;
  margin: 20px
}
li h2{
  font-size: 14px;
  font-family: 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', Meiryo, メイリオ, Osaka, 'MS PGothic', arial, helvetica, sans-serif;
  text-align: center;
  font-weight: bold;
}
/* 全体のスタイル */
.c-btn{
  display: inline-block;
  margin: 20px;
  padding: 8px 18px;
  font-size: 16px;
  font-family: 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', Meiryo, メイリオ, Osaka, 'MS PGothic', arial, helvetica, sans-serif;
  border: 1px solid #5ab4bd;
  background-color: #5ab4bd; 
  color: #fff;
  border-radius: 5px;
  position: relative;
  top: 0;
  transition: all 0.1s ease-in-out;
}
.c-btn:hover{
  text-decoration: none;
  color: #fff;
}

/* ここから個別のスタイル */
.hover1:hover{
  top: -3px;
  box-shadow: 0 3px 3px rgba(0,0,0,0.2);
}
.hover2:hover{
  color: #5ab4bd; 
  background-color: transparent;
  box-shadow: 0 0 4px 1px rgba(90,180,189,0.5) inset;
  text-shadow: 1px 1px 2px #fff; 
}
.hover3 i{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid transparent;
  text-align: center;
  transition:
  border-top-color 0.1s linear, border-right-color 0.15s linear, border-bottom-color 0.20s linear, border-left-color 0.25s linear;
}
.hover3:hover i{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border-color: #fff;
  text-align: center;
}
.hover4{
  width: 150px;
  text-align: center;
  border: none;
}
.hover4:hover{
  box-shadow: 0 1px 9px rgba(0,0,0,0.3);
  letter-spacing: 2px;
  background-color: rgb(126,197,204);
}
.hover5{
  box-shadow: 0 2px 0 rgba(72,144,151, 1);
}
.hover5:hover{
  position: relative;
  top: -1px;
  background-color: rgb(126,197,204);
  box-shadow: 0 3px 0 rgba(72,144,151, 1);
}
              
            
!

JS

              
                
              
            
!
999px

Console