使用原生HTML+CSS制作一个分割线

<html>
<title>分割线</title>
<body>
<div>
<span>设备:</span>
<span>1</span>
</div>
<div class="order">
  <span style="white-space:pre">   </span><span class="line"></span>
  <span style="white-space:pre">   </span><span class="txt">这里是一个分割线</span>
  <span style="white-space:pre">   </span><span class="line"></span>
</div>
<div>
<span>设备:</span>
<span>2</span>
</div>
<style type="text/css">
.order {
  height: 20px;
  line-height: 20px;
  text-align: center;
}

.order .line {
  display: inline-block;
  padding-top : 3px;
  width: 40%;
  border-top: 1px solid #666666;
}

.order .txt {
  color: #333333;
  font-size: 12px;
  vertical-align: middle;
}
</style>
</body>
</html>

效果如下图所示:
在这里插入图片描述

你可能感兴趣的:(Vue,HTML与CSS,JavaScript)