I am trying to come up with a selector that would apply to only those td
s that have a child with special class. To achieve this, I am trying to use has
selector. What I am doing wrong here ?
tr td:has(.test_has' {
background: red;
}
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>
<div class="test">Griffin</div>
</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
</tr>
</table>