边线左侧划出,右侧收起,关键点就是 改变background-position的位置left -> right
.div { background: linear-gradient(to right, #ec695c, #61c454) no-repeat right bottom; background-size: 0 2px; transition: background-size 1.3s; } .div:hover { background-position-x: left; background-size: 100% 2px; }
标签:动画,right,background,2px,边线,position,size From: https://www.cnblogs.com/mengff/p/17850134.html