Does bootstrap have builtin padding and margin classes?

后端 未结 9 2323
庸人自扰
庸人自扰 2020-12-25 09:57

Does Bootstrap have built-in padding and margin classes like pad-10, mar-left-10 or I have to add my own custom classes? For example, similar to th

9条回答
  •  悲&欢浪女
    2020-12-25 10:32

    This is taken from the docs and it works very well. Here is the link

    • m - for classes that set margin
    • p - for classes that set padding

    Where sides are one of:

    • t - for classes that set margin-top or padding-top
    • b - for classes that set margin-bottom or padding-bottom
    • l - for classes that set margin-left or padding-left
    • r - for classes that set margin-right or padding-right

    if you want to give margin to the left use mt-x where x stands for [1,2,3,4,5]

    same for padding

    example be like

    Use only p-x or m-x for getting padding and margin of x from all sides.

提交回复
热议问题