Margins and Padding
Learn how to implement margins and padding using Bootstrap classes.
We'll cover the following
Spacing is a crucial part of having a good user interface. We use margin
and padding
properties to incorporate spacing between and inside elements.Margins and padding are implemented using the .m
and .p
classes, respectively.
We can adjust the spacing of margins and padding using the classes .m-*
and .p-*
. The *
refers to a number from 0
to 5
. The spacing provided by those values is:
0
: 01
: .25rem2
: .5rem3
: 1rem4
: 1.5rem5
: 3rem
Let’s take a look at the code implementation below.
Get hands-on with 1400+ tech skills courses.