Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the bootstrap badge always the default color?

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?

like image 430
Picco Avatar asked Mar 16 '17 15:03

Picco


People also ask

What is the use of badge in bootstrap?

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.

Which class is used to create a badge in bootstrap?

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.

What are badges which class will you use to make your badge look more rounded?

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.

Which bootstrap 4 class is used to add badges to any content?

Use . badge class to provide your visitors with highlighted, new or unread items by adding it to links, text navs, and more.


2 Answers

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>
like image 61
sparta93 Avatar answered Oct 04 '22 00:10

sparta93


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.

like image 25
Imran Avatar answered Oct 04 '22 00:10

Imran