I'm trying to change the tooltip background-color for the icons
with the classes alert-danger
to be red and alert-success
to be green through these commands:
.alert-danger + .tooltip > .tooltip-inner {
background-color: red !important;
}
.alert-success + .tooltip > .tooltip-inner {
background-color: green;
}
.alert-danger + .tooltip > .tooltip.bs-tooltip-top .arrow::before{
border-top-color: red;
}
.alert-success + .tooltip > .tooltip.bs-tooltip-top .arrow::before{
border-top-color: green;
}
I've found this solution on this StackOverflow link.
The problem that I'm facing is that every time I hover my mouse over the icon, the Boostrap code creates a div
element at the bottom of the body
tag so that the code that I was loading does not work as expected.
How can I resolve this issue?
Edit
My HTML code is as follows:
<i class="far fa-check-circle alert-success" data-toggle="tooltip" data-original-title="Sim"></i>