Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I customize Bootstrap tooltips to match my site's theme?
Asked on Feb 14, 2026
Answer
To customize Bootstrap tooltips to match your site's theme, you can use custom CSS to override the default styles. Here's a simple example of how to change the tooltip's background color and text color.
<!-- BEGIN COPY / PASTE -->
<style>
.custom-tooltip .tooltip-inner {
background-color: #343a40; /* Dark background */
color: #ffffff; /* White text */
}
.custom-tooltip .arrow::before {
border-top-color: #343a40; /* Match 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.- This example changes the tooltip's background to dark and text to white.
- The `.custom-tooltip` class is used to apply these styles specifically to tooltips with this class.
- Ensure you include the Bootstrap JavaScript to enable tooltip functionality.
- Adjust the colors in the CSS to fit your site's theme.
Recommended Links:
