Bootstrap 4 provides comprehensive utility classes for managing margins and paddings across different screen sizes, known as the mb (margin bottom) classes. These classes offer flexibility in setting element spacing for varying viewports, as described below:
Understanding class="mb-0"
The class="mb-0" specifically targets the bottom margin of an element and sets it to 0. This class falls under the margin utility class category and is used to remove the bottom margin completely.
Bootstrap Margin and Padding Utility Class Format
Bootstrap utilizes a consistent naming convention for its margin and padding utility classes:
{property}{sides}-{size} or {property}{sides}-{breakpoint}-{size}
Property:
Sides:
Breakpoints:
Size:
Example Usage
<code class="html"><p class="mb-0">Lorem ipsum</p></code>
This code applies the class="mb-0" to the paragraph element, removing its bottom margin.
Additional Resources
For more comprehensive information, refer to the following resources:
The above is the detailed content of How does the Bootstrap class \'mb-0\' affect the margin of an element?. For more information, please follow other related articles on the PHP Chinese website!