Bootstrap 4有内置的水平分隔符吗?我可以做到这一点,
<style type="text/css">
.h-divider{
margin-top:5px;
margin-bottom:5px;
height:1px;
width:100%;
border-top:1px solid gray;
}
</style>
但我希望使用内置的Bootstrap CSS,但我在文档中找不到它的位置,也许我错过了。Bootstrap 4有内置的水平分隔符吗?我可以做到这一点,
<style type="text/css">
.h-divider{
margin-top:5px;
margin-bottom:5px;
height:1px;
width:100%;
border-top:1px solid gray;
}
</style>
但我希望使用内置的Bootstrap CSS,但我在文档中找不到它的位置,也许我错过了。.divider-text {
position: relative;
text-align: center;
margin-top: 15px;
margin-bottom: 15px;
}
.divider-text span {
padding: 7px;
font-size: 12px;
position: relative;
z-index: 2;
}
.divider-text:after {
content: "";
position: absolute;
width: 100%;
border-bottom: 1px solid #ddd;
top: 55%;
left: 0;
z-index: 1;
}
PUG 代码:
p.divider-text
span.bg-light OR
HTML:
<p class="divider-text"><span class="bg-light">OR</span></p>
可视化结果:
我在我的项目中使用了这个例子:
html:
<hr class="my-3 dividerClass"/>
css:
.dividerClass{
border-top-color: #999
}
bootstrap 5.2
<div class="vr"></div>