LoginSignup
25
20

More than 5 years have passed since last update.

マウスオーバーするとキラーンと光るボタンを実装する

Last updated at Posted at 2016-01-13

参考画像(gif)

ぜひ作ってみてください。
btn.gif

サンプル

html

<div class="login_leave">
  <a href="#" class="btnLogin">プレミアム会員登録</a>
</div><!-- /.login_leave -->

css

/* ログインボタン */
.login_leave {
  // overflow: hidden;
}
.btnLogin {
  font-size: 14.4px;
  font-weight: normal;
  line-height: 36px;
  color: #fff;
  background: #000;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  position: relative;
  top: -5px;
  display: block;
  width: 300px;
  margin: auto;
  padding: 4px 10px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  text-shadow: none;
  white-space: nowrap;
  border: none;
  border-radius: 3px;
  vertical-align: top;
  outline: none;
  transition: all .3s;

}
.btnLogin:hover {
  overflow: hidden;
  opacity: .8;
}

.btnLogin:after{
  visibility: hidden;
  position: absolute;
  left: -72px;
  top: 0;
  height: 100%;
  content: "";
  -ms-transform: skew(-45deg);
  -webkit-transform: skew(-45deg);
  transform: skew(-45deg);
  border-left: solid 30px rgba(255,255,255,0.2);
}

.btnLogin:hover:after {
  visibility: visible;
  left: 120%;
  -webkit-transition: left 200ms linear;
  transition: left 200ms linear;
}

25
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
20