Bootstrap Badges - Bootstarp Tutorial
Bootstrap Badges
- Badges scale to match the size of the immediate parent element by using relative font sizing and em units. As of v5, badges no longer have focus or hover styles.
Sample Code
Output
Bootstrap Badges Button
- Badges can be used as part of links or buttons to provide a counter.
Sample Code
Output
Bootstrap Badges Positioned Example 1
- Bootstrap badges can be positioned using CSS positioning properties such as position, top, bottom, left, and right.
Sample Code
Output
Bootstrap Badges Positioned Example 2
Sample Code
Output
Bootstrap Badges Background Colors
- bg-primary: Blue background, for the main or primary action of the page.
- bg-secondary: Gray background, for secondary actions or information.
- bg-success: Green background, for successful or positive actions.
- bg-danger: Red background, for critical or dangerous actions.
- bg-warning: Yellow background, for warning or cautionary actions.
- bg-info: Light blue background, for informative or neutral messages.
- bg-light: Light gray background, for subdued or less important information.
- bg-dark: Dark gray background, for emphasis or contrast.
Sample Code
Output
Bootstrap Pill Badges
- Bootstrap pill badges are similar to regular badges, but they have rounded corners and a pill-like shape. They are often used to indicate different categories or filters in a webpage.