答案 0 :(得分:4)
我建议使用伪元素来创建第二个边框,然后是简单的演示。
div {
width: 200px;
height: 20px;
border-bottom: 1px solid black;
position: relative;
}
div:after {
position: absolute;
bottom: 0; /* or -1px for covering it */
left: 50px;
width: 100px;
content: '';
border-bottom: 1px solid red;
}
<div></div>
答案 1 :(得分:2)
您可以尝试这样的事情
div {
width: 300px;
height: 100px;
border-bottom: 2px solid grey;
position:relative;
}
div:after {
position: absolute;
content: "";
width: 50%;
height: 2px;
background: orange;
bottom: 0px;
left: 50%;
transform: translate(-50%, 0%)
<div></div>