.line{ width: 140px; height: 1px; background: -webkit-linear-gradient(left, rgb(12, 25, 69) -4%,#9adfef 50%,rgb(12, 25, 69) 100%); } 效果如下: