html:
<div class="post">
<h2>Post</h2>
<a href="#"> a link</a>
</div>
<div class="post">
<h2>Post</h2>
</div>
<div class="post">
<a href="#"> a link</a>
</div>
Want to target the .post has <h2>, also has <a>
.post:has(h2):has(a) {
background: red;
}