VOOZH about

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

⇱ Bootstrap 5 Cards Border - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Cards Border

Last Updated : 26 Apr, 2024

Bootstrap 5 Cards Border is part of the utilities that can be used to add borders on cards. Borderless cards are so ugly but the cards of bootstrap will always have borders. According to this utility, classes are used to define the color of the card borders.

Bootstrap 5 Cards Border Classes:

ClassDescription
border-primarySet card border color to blue
border-secondarySet card border color to gray
border-successSet card border color to green
border-dangerSet card border color to red
border-warningSet card border color to yellow
border-infoSet card border color to sky blue
border-lightSet card border color to light gray
border-darkSet card border color to dark gray

Syntax:

<div class="card border-warning ">
 <div class="card-header">..</div>
 <div class="card-body">
 <h5 class="card-title">...</h5>
 <p class="card-text">...</p>
 </div>
</div>

Examples of Bootstrap 5 Cards Border

Example 1: In this example, we Bootstrap 5 Cards with colored borders, featuring HTML content. Each card displays a header with "HTML" and provides information about Hypertext Markup Language.

Output:

👁 CradBorderColor
Bootstrap 5 Cards Border Example Output

Example 2: In this example, we will use Bootstrap 5 cards with various colored borders, each displaying a header with "HTML" and content about Hypertext Markup Language. Borders include primary, secondary, light, and dark.

Output:

👁 BorderColor2
Bootstrap 5 Cards Border Example Output
Comment
Article Tags:

Explore