Home > Net >  Bootstrap success icon showing white on white instead of green?
Bootstrap success icon showing white on white instead of green?

Time:12-11

I copied the code directly from the bootstrap docs (below) but for some reason my "success" badge is showing as white text on a white background? I can highlight the text and it's "there" but it's not showing like it should.

Code from bootstrap:

<span >Success</span>

Code from my page:

<h5 ><%= title %> <span >Success</span>
    </h5>

Any idea why it's not working properly?

CodePudding user response:

The correct thing is badge bg-success if you use bootstrap 5

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/>

<h5 >
<%= title %>
<span >Success</span>
 </h5>
    
<span >Success</span>

Most likely, you are using bootstrap 5 in your project and that is why it appears blank. If you used bootstrap 4 your code would work.

Bootstrap 5 badge

  • Related