6

CSS Creative Button Hover Effects - Online Tutorials

 3 years ago
source link: http://misaka.im/index.php/archives/37/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

CSS Creative Button Hover Effects - Online Tutorials

2018.10.14默认分类 0 评

鼠标悬停动画效果

<a href="#">
    Button
</a>
body {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
a {
  position: relative;
  padding: 20px 20px 20px 30px;
  color: #262626;
  font-size: 24px;
  font-family: sans-serif;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 10px;
  &:before {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background: #262626;
    transform-style: linear;
    transition-property: height, width;
    transition-delay: 0.5s, 1s;
    transition-duration: 0.5s;
  }
  &:after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #fbff1e;
    transform: scaleX(0);
    transition: 0.5s;
    transition-delay: 0s;
    transform-origin: right;
    z-index: -1;
  }
  &:hover {
    &:before {
      width: 2px;
      height: 100%;
      transition-property: width, height;
    }
    &:after {
      transform: scaleX(1);
    }
  }
}
Sass (Scss)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK