这种样子的边框wxss如何写
发布于 7 年前 作者 zengping 4530 次浏览 来自 问答

图中红圈部分的wxss 应该怎么写能出现这种中间隔断的样式呢,将时间放在中央,用border吗?求指教,谢谢!!

3 回复

用2个单独的view设宽高背景颜色 画成横线就好啦  和时间在一起 3个横排

大概这样子吧

<view class=‘date’>2019-4-8</view>

.date{

display:table;

width: 90%;

line-height: 32rpx;

margin: 20rpx auto;

background-color: #fff;

white-space: nowrap;

border-spacing: 20rpx 0;

}

.date:before,

.date:after{

display: table-cell;

content: ‘’;

width: 50%;

background: linear-gradient(rgb(81, 255, 0),rgb(34, 235, 7)) repeat-x left center;

background-size: 1px 10rpx;

}

很多办法,个人觉得用伪元素最快

回到顶部