In this example, the padding classes are used in paragraphs as follows:Īs such no breakpoint is used, so this applies to viewports from extra small to extra large. The example of Bootstrap padding classes for all directions Now, let me show you the usage of these padding and margin shorthand utility classes in action in Bootstrap 4. I will show you examples for seeing the difference.Ĭombining all the above, the left padding complete code can be (for example): The size can be from value 0 to 5 and auto. blank = margin and padding for all sides.x = For setting left and right padding and margins by the single call.b = defines the bottom-margin or right-padding.t = defines the top-margin or top-padding.r = defines the right-margin or right-padding.l = defines the left-margin or left-padding.Property = m for margin and p for padding You may use the padding and margin shorthand Bootstrap 4 classes as follows:įor other devices/viewports (small, medium, large and extra large): Syntax of using shorthand margin and padding Margin Top, Bottom, Left & Right example.The Bootstrap 4 has built-in utility responsive classes for margin and padding that you may use easily in various elements to manage the spacing. The margin property adds spacing between the elements while CSS padding between the content and container boundary.
0 Comments
Leave a Reply. |