Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I customize Bootstrap's tooltip styling with my own CSS?
Asked on May 10, 2026
Answer
To customize Bootstrap's tooltip styling, you can override the default CSS styles with your own. Here's a simple example of how to customize the tooltip's background color and text color.
<!-- BEGIN COPY / PASTE -->
<style>
.custom-tooltip .tooltip-inner {
background-color: #5a5a5a; /* Custom background color */
color: #ffffff; /* Custom text color */
}
.custom-tooltip .arrow::before {
border-top-color: #5a5a5a; /* Custom arrow color */
}
</style>
<button type="button" class="btn btn-secondary custom-tooltip" data-bs-toggle="tooltip" data-bs-placement="top" title="Custom tooltip">
Hover me
</button>
<script>
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
</script>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- Use the `.custom-tooltip` class to apply custom styles to specific tooltips.
- Override the `.tooltip-inner` for background and text color changes.
- Adjust the `.arrow::before` for the tooltip arrow color.
- Ensure you initialize tooltips using Bootstrap's JavaScript API.
Recommended Links:
