中间带文字的hr分割线
Post on 2021-10-27
106
0
<hr class="hr">
.hr {
color: #000;
border: 0;
font-size: 12px;
padding: 10px 0;
position: relative;
}
.hr::before {
content: "分隔线";
position: absolute;
padding: 0 10px;
line-height: 1px;
border: solid red;
border-width: 0 100vw;
white-space: nowrap;
left: 50%;
transform: translateX(-50%);
}
暂无评论