【发布时间】:2020-08-15 13:44:58
【问题描述】:
我试图在两个文本元素之间添加一条线,如下图 HTML 中的图片,但我不能。我只能在“培训计划”之间添加一行,其他文本将在下一行。
h3 {
position: relative;
}
h3 span {
background-color: white;
padding-right: 10px;
}
h3:before {
content:"";
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 0.5em;
width: 60%;
border-top: 1px solid black;
z-index: -1;
}
<h3 style="font-family:Montserrat"><span>Training program</span></h3>
<h3 style="font-family:Montserrat; text-align:right; margin-top:10px"><span>Read more</span></h3>
我想像这张图片一样添加一行。有人可以帮帮我吗?
【问题讨论】:
标签: html css frontend web-frontend