![]() |
VOOZH | about |
In Bootstrap 5, the margin and padding utilities are used to add space around elements. The margin utilities are used to add space outside of an element, while the padding utilities are used to add space inside of an element.
Bootstrap 5 Utilities Margin and padding Classes: There are no different classes for these utilities, you can use the margin and padding spacing utilities to assign the space around the elements.
Syntax:
<tag class="m-{size}-{direction}">...</tag>
Note: Classes described for 'm' for margin,'p' for padding,'{size}': The size of the margin or padding, where size can be 0, 1, 2, 3, 4, 5 and ' {direction}': The direction of the margin or padding, where direction can be t, b, l, r, x, y.
Example 1: In this example, we will demonstrate bootstrap 5 margins.
Output:
Example 2: In this example, we will demonstrate bootstrap 5 paddings.
Output:
Reference: https://getbootstrap.com/docs/5.0/layout/utilities/#margin-and-padding