边框中间添加文字(边框线在文字两边横穿文字)vue elementui

边框中间添加文字

(边框线在文字两边横穿文字)

方法:给文字区域定义一个长和宽,然后让其背景是白色,再把文字移动到相应的位置就可以

具体效果如下:

 

代码如下:

<template>
  <div class="border">
    <div class="border-title">
      <span>我的消息:</span>
      <span>10</span>
    </div>
  </div>
</template>
<style scoped lang="less">
.border {
  width: 700px;
  height: 200px;
  margin-top: 30px;
  margin-left: 20px;
  border: 2px solid black;
  border-radius: 4px;
}
.border-title {
  width: 110px;
  height: 30px;
  background: white;
  text-align: center;
  margin-top: -12px;
  margin-left: 10px;
}
</style>
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值