VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-border-color/

⇱ Bootstrap 5 Border color - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Border color

Last Updated : 5 Apr, 2024

Bootstrap 5 Border utility is used to set the style of the border element. The border styles can be of border-color, border-width, border-radius, etc.

Border color is used to set the color of the border element using utilities built on our theme colors. 

Border color used Classes:

Class NameDescription
border-primarySets the primary color for the border.
border-secondarySets the secondary color for the border.
border-successSets the success color for the border.
border-dangerSets the danger color for the border.
border-warningSets the warning color for the border.
border-infoSets the info color for the border.
border-lightSets the light color for the border.
border-darkSets the dark color for the border.
border-whiteSets the white color for the border.

Syntax:

<div class="border border-*">
 Content
</div>

Example 1: In this example, we will add different color borders on the span elements.

Output:

👁 BootstrapBorder
Bootstrap 5 Border color Example Output


Example 2: In this example, we will add different color borders with different border widths of the span elements.

Output:

👁 BootstrapBorder2
Bootstrap 5 Border color Example Output
Comment

Explore