Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I customize the appearance of Bootstrap's tooltips using CSS?
Asked on Apr 10, 2026
Answer
To customize the appearance of Bootstrap's tooltips, you can override the default CSS styles. Here's a simple example to demonstrate how you can change the background color and text color of tooltips.
<!-- BEGIN COPY / PASTE -->
<style>
.tooltip-inner {
background-color: #333; /* Change background color */
color: #fff; /* Change text color */
}
.tooltip-arrow::before {
border-top-color: #333; /* Change arrow color */
}
</style>
<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top" title="Tooltip text">
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.- The `.tooltip-inner` class is used to style the tooltip's content area.
- The `.tooltip-arrow::before` pseudo-element is used to style the tooltip's arrow.
- Ensure that Bootstrap's JavaScript is properly initialized to activate tooltips.
- Customize other properties as needed, such as padding or border-radius, by adding more CSS rules.
Recommended Links:
