Phi*_*enn 94 css twitter-bootstrap twitter-bootstrap-4 bootstrap-4
在最新的机制的文档有:
<p class="mb-0">Lorem ipsum</p>Run Code Online (Sandbox Code Playgroud)
问:什么是mb-0?
Aka*_*eet 172
Bootstrap具有广泛的响应边距和填充实用程序类.它们适用于所有断点:
xs(<= 576px),sm(> = 576px),md(> = 768px),lg(> = 992px)或xl(> = 1200px))
这些类的格式如下:
{property} {sides} - {size}代表xs&{property} {sides} - {breakpoint} - {size}代表sm,md,lg和xl.
m - 设定保证金
p - 设置填充
t - 设置margin-top或padding-top
b - 设置margin-bottom或padding-bottom
l - 设置margin-left或padding-left
r - 设置margin-right或padding-right
x - 设置padding-left和padding-right或margin-left和margin-right
y - 设置padding-top和padding-bottom或margin-top和margin-bottom
空白 - 在元素的所有4个边上设置边距或填充
0 - 将边距或填充设置为0
1 - 将边距或填充设置为.25rem(如果font-size为16px则为4px)
2 - 将边距或填充设置为.5rem(如果font-size为16px则为8px)
3 - 将边距或填充设置为1rem(如果字体大小为16px,则为16px)
4 - 将边距或填充设置为1.5rem(如果字体大小为16px则为24px)
5 - 将边距或填充设置为3rem(如果font-size为16px则为48px)
自动 - 将保证金设置为自动
Zim*_*Zim 41
它用于创建0(margin-bottom:0)的底部边距.您可以在此处查看更多新的间距实用程序类:https://getbootstrap.com/docs/4.0/utilities/spacing/
相关:如何在Bootstrap 4上使用Spacing Utility类
sta*_*sta 19
m - 对于设置边距的类,如下所示:
mt - 对于设置的类 margin-topmb - 对于设置的类 margin-bottomml - 对于设置的类 margin-leftmr - 对于设置的类 margin-rightmx- 对于同时设置margin-left和的类margin-rightmy- 对于同时设置margin-top和的类margin-bottom其中 size 是 margin 之一:
0 - 对于通过将边距设置为 0 来消除边距的类,例如 mt-01 -(默认情况下)对于将边距设置为 $spacer * .25 的类,例如 mt-12 -(默认情况下)对于将边距设置为 $spacer * .5 的类,例如 mt-23 -(默认情况下)对于将边距设置为 $spacer 的类,例如 mt-34 -(默认情况下)对于将边距设置为 $spacer * 1.5 的类,例如 mt-45 -(默认情况下)对于将边距设置为 $spacer * 3 的类,例如 mt-5auto - 对于将边距设置为自动的类,例如 mx-auto小智 5
Bootstrap 具有我们用于样式化的预定义类。如果你熟悉CSS,你就会知道什么是padding、margin和spacing等。
mb-0 = 边距底部:0;
好的,现在进一步了解一下,bootstrap 有更多的保证金类别,包括:
mt- = margin-top
mb- = margin-bottom
ml- = margin-left
mr- = margin-right
my- = it sets margin-left and margin-right at the same time on y axes
mX- = it sets margin-bottom and margin-top at the same time on X axes
Run Code Online (Sandbox Code Playgroud)
这里解释了这一点以及更多内容https://getbootstrap.com/docs/5.0/utilities/spacing/ 最好的学习方法是通过https://getbootstrap.com网站本身。它解释了很多关于其内置类的内容。