效果:
实现:
利用渐变函数,以背景图形式搞,这样切换不会影响到变化效果
写法:
.tab-active{
color: #395371;
background-image: linear-gradient(#395371, #395371);
background-repeat: no-repeat;
background-size: 100% 4rpx;
background-position: bottom;
}
background-size: 宽 高;
background-position: 图片位置;
background-repeat: no-repeat; 图片不重复,只要一张