Using Bootstrap 5, I am currently working on creating a unique custom tooltip. I found the necessary markup in the Bootstrap 5 documentation here.
After some research, I discovered that tooltips in Bootstrap 5 are not contained within the calling element, but rather exist as siblings. I am attempting to implement a custom class using the following markup:
// CSS test option #1
.custom-tooltip + .tooltip > .tooltip-inner
{
text-align: left;
max-width: 500px;
}
// CSS test option #2
.custom-tooltip ~ .tooltip > .tooltip-inner
{
text-align: left;
max-width: 500px;
}
<span class="custom-tooltip" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-html="true" title="The tooltip text<br/>Extra textC">
<svg ... ></svg>
</span>
Although using just .tooltip-inner
functions correctly for a general tooltip, I need to implement various custom tooltips without creating a global tooltip.