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
Bootstrap 4 has a new notation for margin and padding classes. Refer to Bootstrap 4.0 Documentation - Spacing.
From the documentation:
Notation
Spacing utilities that apply to all breakpoints, from
xs
toxl
, have no breakpoint abbreviation in them. This is because those classes are applied frommin-width: 0
and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.The classes are named using the format
{property}{sides}-{size}
forxs
and{property}{sides}-{breakpoint}-{size}
forsm
,md
,lg
, andxl
.Examples
.mt-0 { margin-top: 0 !important; }
.p-3 { padding: $spacer !important; }