<div class="box">测试</div> ··· .box{ color: #ccc; text-align: center; position: relative; &::after { position: absolute; left: 24rpx; top: 52%; content: ''; width: calc(50% - 100rpx); height: 1rpx; background-color: #ccc; } &::before { position: absolute; right: 24rpx; top: 52%; content: ''; width: calc(50% - 100rpx); height: 1rpx; background-color: #ccc; } }
emm,我这里用了sass。
标签:15,伪类,color,after,position,ccc,before From: https://www.cnblogs.com/iuniko/p/17483050.html