Is there a way to customize the tooltip background-color for icons with the classes "alert-danger" to red and "alert-success" to green using the following CSS 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 came across this solution on a StackOverflow thread.
The issue I'm encountering is that whenever I hover over the icon, Bootstrap code generates a new div element at the bottom of the body tag, causing my custom code not to work as expected.
Any suggestions on how to resolve this problem?
Edit
This is the HTML snippet in question:
<i class="far fa-check-circle alert-success" data-toggle="tooltip" data-original-title="Sim"></i>