YouTip LogoYouTip

Bootstrap5 Utilities

Bootstrap 5 provides many useful classes to help us quickly achieve effects without having to repeat writing some CSS code. * * * ## Background Color When setting the background color of different elements, you need to use the .text-* class to set the matching text color: !(#) ## Example
.bg-primary
.bg-secondary
.bg-success
.bg-danger
.bg-warning
.bg-info
.bg-light
.bg-dark
.bg-body
.bg-white
.bg-transparent
[Try it Yourself Β»](#) The .bg-gradient class can set the background color gradient effect: ## Example
.bg-primary
.bg-secondary
.bg-success
.bg-danger
.bg-warning
.bg-info
.bg-light
.bg-dark
.bg-body
.bg-white
.bg-transparent
[Try it Yourself Β»](#) * * * ## Borders We can use border related classes to display borders as needed: !(#) ## Example
[Try it Yourself Β»](#) The .border-1 to .border-5 classes are used to set the border width: ## Example [Try it Yourself Β»](#) The following sets different border colors: ## Example [Try it Yourself Β»](#) The **rounded** related classes are used to set rounded corners: !(#) ## Example ..................... [Try it Yourself Β»](#) The .rounded-0 to .rounded-3 classes are used to set the size of rounded corners: ## Example ............ [Try it Yourself Β»](#) * * * ## Float and Clearfix Use .float-end class to float element to the right, .float-start class to float to the left, and .clearfix class to clear floats: ## Example
<span class="float
← Prop Element OffsetwidthBootstrap5 Scrollspy β†’