How do you apply margin or padding in Bootstrap using utility classes?

  • margin-xs, padding-xs
  • m-2, p-3
  • mx-auto, px-4
  • m-lg-5, p-md-2
In Bootstrap, you can apply margin and padding using utility classes such as m-2 for margin, p-3 for padding, mx-auto for horizontal margin, px-4 for horizontal padding, etc. These classes follow a shorthand notation, where the first letter represents the property (m for margin, p for padding), and the number represents the size.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *