I am using Bootstrap 5 and am attempting to create a custom tooltip. I see the markup used in the Bootstrap 5 documentation here.
I gathered (and looked online) that the tooltips are not in the calling element and are siblings. I am trying to use a custom class like so with the below 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>
So if you only use .tooltip-inner
, obviously, it works fine, but I do not want a global tooltip and need to have different custom tooltips.