底部滑动的border

2018-10-07  本文已影响0人  索伯列夫

HTML:

  <div>底部滑动的<a>border</a></div>

CSS:

a{
  display:inline-block;
}
a:hover::after{
  content:'';
  display:block;
  top:100%;
  left:0;
  height:2px;
  background: #000;
  animation:0.5s linear silde;
}
@keyframes silde{
  from{
    width:0;
  }
  to{
    width:100%;
  }
}
上一篇 下一篇

猜你喜欢

热点阅读