I use the bootstrap badge in my html code and I use this code:
<label for="collaborativa_utenti_pollo"><span class="badge badge-warning">pollo</span><br></label>
The badge must be show with red color but it appears me with default color. Anyone can help me?
Badges scale to match the size of the immediate parent element by using relative font sizing and em units. Badges can be used as part of links or buttons to provide a counter. Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies.
Bootstrap Badges are numerical indicators used to show that how many items are associated with the specific link. Badges are used to highlight new or unread items. The class . badge within the <span> element is used to create badges.
badge-pill class can be used to make badges corner more rounded which means the badge will contain larger border radius and will also contain additional border padding.
Use . badge class to provide your visitors with highlighted, new or unread items by adding it to links, text navs, and more.
Bootstrap v4:
For red color badge, use badge-danger
<label for="collaborativa_utenti_pollo"><span class="badge badge-danger">pollo</span><br></label>
JSFiddle - https://jsfiddle.net/mearaf9r/
Bootstrap v3
Check here - https://jsfiddle.net/pf66jvfr/
you have to use progress-bar-danger
to color the badge.
<label for="collaborativa_utenti_pollo"><span class="badge progress-bar-danger">pollo</span><br></label>
Use the following code to make a badge with bootstrap warning background:
<span class="badge bg-danger">pollo</span>
bg-danger
class can be used to set danger the background color. In bootstrap's documentation there is no class mentioned as badge-danger
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With