Tell me please, what am I doing wrong? I need to set the style for all td:hover that don't contain a table inside. I tried to make exceptions through the selector and many more different ways. It is desirable to show several solutions, very interesting
My css style:
.table-md td:not(:has(>table)):hover{
background-color: #e0effd;
transition: 0.2s ease;
-moz-transition: 0.2s ease;
-webkit-transition: 0.2s ease;
transform: scale(1.02);
-moz-transform: scale(1.02);
-webkit-transform: scale(1.02);
}
HTML page:
<table>
<thead>
<tr>
<th>...</th>
<th>...</th>
<th>...</th>
</tr>
</thead>
<tbody>
<tr>
<!--For these, the style should be applied-->
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr style="display: none;">
<td collspan="10"> <!--For it, style shouldn't be applied-->
<table>
<thead>
<th>...</th>
<th>...</th>
<th>..</th>
</thead>
<tbody>
<tr>
<!--For these, the style should be applied-->
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr>
<!--For these, the style should be applied-->
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
Thanks!