In Bootstrap 5, the Utility classes provide a set of helpful CSS classes that you can use to style and manipulate elements in a flexible way. These utility classes are designed to address common styling needs and can be applied directly to HTML elements without the need for custom CSS. Here are some examples of Bootstrap 5 utility classes:
1. Spacing Utilities:
- `.m-1`, `.mt-2`, `.mb-3`: Margin classes for setting the margin of an element.
- `.p-1`, `.pt-2`, `.pb-3`: Padding classes for setting the padding of an element.
- `.mx-auto`: Center an element horizontally by applying automatic left and right margins.
2. Text Utilities:
- `.text-center`, `.text-muted`, `.text-uppercase`: Classes for text alignment, color, and transformation.
- `.font-weight-bold`, `.text-decoration-underline`: Classes for font weight and text decoration.
3. Display Utilities:
- `.d-flex`, `.d-block`, `.d-none`: Classes for controlling the display property of an element.
- `.flex-row`, `.flex-column`, `.flex-wrap`: Classes for defining flexbox behavior.
4. Flexbox Utilities:
- `.justify-content-start`, `.justify-content-center`, `.justify-content-between`: Classes for controlling the horizontal alignment of flex items.
- `.align-items-start`, `.align-items-center`, `.align-items-end`: Classes for controlling the vertical alignment of flex items.
5. Visibility Utilities:
- `.visible`, `.invisible`: Classes for showing or hiding elements.
6. Sizing Utilities:
- `.w-50`, `.h-100`: Classes for setting the width and height of an element.
- `.max-width-75`, `.min-height-200`: Classes for setting the maximum width and minimum height of an element.
These are just a few examples of the utility classes available in Bootstrap 5. You can combine and apply these classes to customize the appearance and behavior of your elements without writing additional CSS code.
For a comprehensive list of utility classes and their usage, refer to the Bootstrap documentation on Utilities: https://getbootstrap.com/docs/5.1/utilities/overview/.
Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.
We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc