Skip to main content

Spacing

Spacing classes include margin and padding.

The syntax is:

.{property}{side}-{size}

where

  • property is one of:

    • m - for margin
    • p - for padding
  • side is one of:

    • t - for margin-top and padding-top
    • b - for margin-bottom and padding-bottom
    • l - for margin-left and padding-left
    • r - for margin-right and padding-right
    • x - x-axis, for -left and -right margin and padding
    • y - y-axis, for -top and -bottom margin and padding
  • size is one of:

    • 0 - 2px
    • 1 - 4px
    • 2 - 8px
    • 3 - 12px
    • 4 - 16px
    • 5 - 20px
    • 6 - 24px
    • 8 - 32px
    • 10 - 40px
    • 12 - 48px
    • 20 - 80px
    • 28 - 112px
    • 36 - 144px
    • 48 - 192px
info

Use .p-{size} for padding on all sides and .m-{size} for margin on all sides.

Some Examples

<div class="p-0 m-3">...</div><div class="px-5 py-3 m-3">...</div><div class="mx-2 my-4 p-4">...</div>