鼠标悬停动画效果

栏目: Html · 发布时间: 7年前

鼠标悬停动画效果

<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);
    }
  }
}

以上所述就是小编给大家介绍的《鼠标悬停动画效果》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Defensive Design for the Web

Defensive Design for the Web

37signals、Matthew Linderman、Jason Fried / New Riders / 2004-3-2 / GBP 18.99

Let's admit it: Things will go wrong online. No matter how carefully you design a site, no matter how much testing you do, customers still encounter problems. So how do you handle these inevitable bre......一起来看看 《Defensive Design for the Web》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

在线进制转换器
在线进制转换器

各进制数互转换器

URL 编码/解码
URL 编码/解码

URL 编码/解码