CSS:水平线,部分较粗

我怎样才能用 CSS 实现这样的目标:

谢谢

回答

使用单个 div,并制作较厚的部分 .bar::before

.bar{
  background: #AAA;
  height: 3px;
  margin-top: 40px;
  position:relative;
}

.bar::before{
  content: '';
  display: block;
  width: 30%;
  background: #B5651D;
  height: 10px;
  position:absolute;
  top:-10px;
}
<div class='bar'></div>


以上是CSS:水平线,部分较粗的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>