SpacingSpacing utility is used to assign the responsive-friendly margin or padding values to an element or a subset of its sides with shorthand classes. It includes individual properties, all properties and vertical and horizontal properties. It classes are built from a default Sass map ranging from .25rem to 3rem. NotationThe spacing utilities that apply to all breakpoints, from xs to xl, don't have breakpoint abbreviation in them. It?s because those classes are applied from min-width: 0 and up, and 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} for xs and {property}{sides}-{breakpoint}-{size} for sm, md, lg, and xl. Here, "property" is one of the following:
"sides" is one of the following:
"size" is one of the following:
Note: You can add more sizes by adding entries to the $spacers Sass map variable.ExampleLet's take an example to see usage of these classes: Horizontal centeringBootstrap also supports .mx-auto class for horizontally centering fixed-width block level content. Content that has display: block and a width set?by setting the horizontal margins to auto. Next TopicBootstrap Typography |