实现菜单底部线条沿着 X 轴的值缩放转换scaleX

效果:

 代码:

a{padding: 10px 10px; position: relative;}
a:before{content: ''; width: 100%; height: 3px; background-color: #f00; transform: scaleX(0); -webkit-transform: scaleX(0); transition: all 0.2s; -webkit-transition: all 0.2s; position: absolute;
    bottom: 0px; left: 0px;}
a:hover{color: #0000d0;}
a:hover:before{transform: scaleX(1); -webkit-transform: scaleX(1);}
原文地址:https://www.cnblogs.com/hool/p/11549961.html