Currently, I am facing an issue with a tooltip displaying when hovering over navigation elements. The problem is that while the tool tip appears over the element being hovered on, it displays underneath all other elements as well. (To clarify, imagine a nav bar where the tool tip of link 1 has the text of link 2 overlapping it, making it unreadable). I have attempted to adjust the z-index of different elements and also tried using the standard Bootstrap method of "data-toggle='tooltip'." However, this approach doesn't seem to render the HTML properly even when utilizing Razor @Html.Raw().
<li class="nav-item tooltip">
<a class="nav-link active" href="#"><i class="fal fa-file-alt"></i> <span>INVOICES</span></a>
<span class="tooltiptext" data-placement="top">@Html.Raw(UIMessages.TTSignUp)</span>
</li>
<li class="nav-item tooltip">
<a class="nav-link active" href="#"><i class="fal fa-pound-sign"></i><span>EXPENSES</span></a>
<span class="tooltiptext">@Html.Raw(UIMessages.TTSignUp)</span>
</li>
<li class="nav-item tooltip">
<a class="nav-link active" data-toggle="tooltip" title="@Html.Raw(UIMessages.TTSignUp)" href="#"><i class="fal fa-pound-sign"></i><span>PENSION</span></a>
<span class="tooltiptext">@Html.Raw(UIMessages.TTSignUp)</span>
</li>
My CSS/SCSS...
.tooltip {
position: relative;
display: inline-block;
opacity: 1 !important;
}
.toptip span {
z-index: 9999999;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 400px;
background-color: $TrigDarkBlue;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 10px 10px 10px 10px;
/* Position the tooltip */
position: absolute;
top: -5px;
left: 5%;
a {
color: $TrigBlue;
}
}
.tooltip:hover .tooltiptext {
visibility: visible;
z-index: 99999;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 20px;
right: 100%;
margin-top: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent $TrigDarkBlue transparent transparent;
z-index: 9999
}
I initially believed that adjusting the z-index of '.tooltiptext' would solve the issue, but apparently it's not that straightforward. Any assistance on this matter would be highly appreciated.
Cheers