What is class="mb-0" in Bootstrap 4?
m - sets margin
p - sets padding
t - sets margin-top or padding-top
b - sets margin-bottom or padding-bottom
l - sets margin-left or padding-left
r - sets margin-right or padding-right
x - sets both padding-left and padding-right or margin-left and margin-right
y - sets both padding-top and padding-bottom or margin-top and margin-bottom
blank - sets a margin or padding on all 4 sides of the element
0 - sets margin or padding to 0
1 - sets margin or padding to .25rem (4px if font-size is 16px)
2 - sets margin or padding to .5rem (8px if font-size is 16px)
3 - sets margin or padding to 1rem (16px if font-size is 16px)
4 - sets margin or padding to 1.5rem (24px if font-size is 16px)
5 - sets margin or padding to 3rem (48px if font-size is 16px)
auto - sets margin to auto
Bootstrap 4
It is used to create a bottom margin of 0 (margin-bottom:0
). You can see more of the new spacing utility classes here: https://getbootstrap.com/docs/4.0/utilities/spacing/
Related: How do I use the Spacing Utility Classes on Bootstrap 4
Bootstrap has a wide range of responsive margin and padding utility classes. They work for all breakpoints:
xs (<=576px), sm (>=576px), md (>=768px), lg (>=992px) or xl (>=1200px))
The classes are used in the format:
{property}{sides}-{size} for xs & {property}{sides}-{breakpoint}-{size} for sm, md, lg, and xl.
m - sets margin
p - sets padding
t - sets margin-top or padding-top
b - sets margin-bottom or padding-bottom
l - sets margin-left or padding-left
r - sets margin-right or padding-right
x - sets both padding-left and padding-right or margin-left and margin-right
y - sets both padding-top and padding-bottom or margin-top and margin-bottom
blank - sets a margin or padding on all 4 sides of the element
0 - sets margin or padding to 0
1 - sets margin or padding to .25rem (4px if font-size is 16px)
2 - sets margin or padding to .5rem (8px if font-size is 16px)
3 - sets margin or padding to 1rem (16px if font-size is 16px)
4 - sets margin or padding to 1.5rem (24px if font-size is 16px)
5 - sets margin or padding to 3rem (48px if font-size is 16px)
auto - sets margin to auto
See more at Bootstrap 4.5 - Spacing
Read more in w3schools
m
- for classes that set margin, like this :
mt
- for classes that setmargin-top
mb
- for classes that setmargin-bottom
ml
- for classes that setmargin-left
mr
- for classes that setmargin-right
mx
- for classes that set bothmargin-left
andmargin-right
my
- for classes that set bothmargin-top
andmargin-bottom
Where size is one of margin :
0
- for classes that eliminate the margin by setting it to 0, likemt-0
1
- (by default) for classes that set the margin to $spacer * .25, likemt-1
2
- (by default) for classes that set the margin to $spacer * .5, likemt-2
3
- (by default) for classes that set the margin to $spacer, likemt-3
4
- (by default) for classes that set the margin to $spacer * 1.5, likemt-4
5
- (by default) for classes that set the margin to $spacer * 3, likemt-5
auto
- for classes that set the margin to auto, likemx-auto