Bootstrap 4边界实用程序 [英] Bootstrap 4 border utilities

查看:91
本文介绍了Bootstrap 4边界实用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得应该很容易找到这个,但是我还没有提出任何建议. 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-3pt-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://www.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆