Bootstrap 4 边界实用程序 [英] Bootstrap 4 border utilities
问题描述
我觉得这应该很明显,但我没有想出任何东西.Bootstrap 4 具有用于添加和删除边框的实用程序类,但是否支持定义边框宽度或样式(如实线或虚线)?
I feel like this should be obvious to find but I have not come up with anything. Bootstrap 4 has utility class for adding and removing a border, but is there support for defining the border width or style like solid or dashed?
<span class="border"></span>
<span class="border-top"></span>
<span class="border-right"></span>
<span class="border-bottom"></span>
<span class="border-left"></span>
有一些类可以更改边距和填充,例如 mr-3
和 pt-2
.
There are some classes that changes the margins and padding such as mr-3
and pt-2
.
也许我只需要自己定义它们?
Maybe I just need to define them myself?
推荐答案
不,Bootstrap 4 中没有用于边框宽度或样式的类.
No, there are no classes in Bootstrap 4 for border width or style.
您可以简单地添加如下内容:
You can simply add something like:
.border-3 {
border-width:3px !important;
}
https://codeply.com/go/ktnEeWExvh
注意:在这种情况下需要 !important
因为 Bootstrap 在许多 实用类,比如border-*
.
NOTE: !important
is needed in this case because Bootstrap also uses !important in many of the utility classes like border-*
.
这篇关于Bootstrap 4 边界实用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!