123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <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>
            
          
!
            
              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);
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console