Remove the conflicting block below:
.green:hover,
.blue:hover,
.red:hover,
.yellow:hover,
.black:hover {
opacity: 0.8;
}
After removing that block, everything should work fine.
The opacity style has been shifted to .tooltip .tooltiptext
, as shown in the stack snippet below.
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
opacity: 0.8; /* <-- Opacity added here */
/* Positioning the tooltip */
position: absolute;
z-index: 1;
top: 100%;
left: 50%;
margin-left: -60px;
}
.tooltip:hover .tooltiptext {
visibility: visible;
}
/* Other relevant CSS styles below this line */
<table>
<tbody>
<tr>
<td style="vertical-align: middle; min-width: 50px !important; font-weight: bold;">FLOOR 1 </td>
<td>
<table>
<tbody>
<tr>
<td style="vertical-align: top;">
</td>
</tr>
<tr>
<td class="red tooltip">Apartment No:1
<div><span class="tooltiptext">Some Data<br>More Data<br>Even More Data<br></span></div>
</td>
</tr>
/* Additional table rows and data structures go here */
</tbody>
</table>
</td>
/* Additional table columns with data here */
</tr>
</tbody>
</table>