鼠标经过底部下划线从中间放大的动画

资料

参考代码:Base Element(可在线查看)

正文

源码


   


This link will be opened in a new tab:   Free Code Tools

Read more:
MDN Documentation

/* Please ❤ this if you like it! */

.wrapper {
  text-align: center;
  padding: 0 15px;
  background-color: #173446;
  color: white;
  display: flex;
  flex-direction: column;
  height: 100vh;
  justify-content: center;
  align-items: center;
  font-size: 1.4em;
}

a {
  color: #999;
  position: relative;
}

a:after {
  background-color: #999;
  bottom: 0;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transition: all .3s ease-in-out 0s;
  visibility: hidden;
  width: 100%;
}

a:hover:after {
  transform: scaleX(1);
  visibility: visible;
}

你可能感兴趣的:(鼠标经过底部下划线从中间放大的动画)