小程序中間有字的分隔線

代碼如下:


wxml

<view class="line">
  <span>到底啦,我是有底線的</span>
</view>


wxss

/* 分隔線--底部 */
.line{
    width: 90%;    /* 分隔線的長度 */
    margin: auto;
    height: 1px;    /* 分隔線粗細 */
    text-align: center;
    font-size: 24rpx;
    color: #aaa;
    background: #ccc;
}
.line span{
    position: relative;
    top: -8px;
    background: #fff;
    padding: 10px 10px;
}



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章